2017-12-19 5 views
0

EXPOを使用してPOSTMANからRNアプリにプッシュ通知を送信しようとしています。私は以下のエラーで終わった:受信者がどのデバイスにも関連付けられていません。ネイティブエクスポを返す

{ 
    "data": { 
     "status": "error", 
     "message": "The recipient \"ExponentPushToken[OrxoEFOL4iLBfbNDSTUskn]\" isn't associated with any device", 
     "details": { 
      "error": "DeviceNotRegistered" 
     } 
    } 
} 

誰かが私を助けに来ることができますか?

答えて

0

デバイスが登録されていないため、権限の問題が疑われます。

Android搭載の場合は、インストール時にプッシュ通知を有効にする必要があります。彼らは有効にされましたか?

IOSを使用している場合は、プッシュ通知を使用するための権限をユーザーに求める必要があります。あなたは正しいアクセス許可を得ましたか?

あなたはそれが許可をユーザーに尋ねていない場合は、権限が付与されているかどうかを確認することができ博覧会の権限を持つ

import { Permissions } from 'expo'; 

を使用して博覧会との権限をインポートすることができます。

const { status: existingStatus } = await Permissions.getAsync(
    Permissions.NOTIFICATIONS 
); 
    let finalStatus = existingStatus; 

    // only ask if permissions have not already been determined, because 
    // iOS won't necessarily prompt the user a second time. 
    if (existingStatus !== 'granted') { 
    // Android remote notification permissions are granted during the app 
    // install, so this will only ask on iOS 
    const { status } = await Permissions.askAsync(Permissions.NOTIFICATIONS); 
    finalStatus = status; 
    } 

これはExpo docsから取得したものです。 https://docs.expo.io/versions/latest/guides/push-notifications.html

標準のシミュレータにプッシュ通知を送信することはできません。博覧会の下で、

Note: iOS and Android simulators cannot receive push notifications, to test them out you will need to use a real-life device. Additionally, when calling Permissions.askAsync on the simulator, it will resolve immediately with “undetermined” as the status, regardless of whether you choose to allow or not.

関連する問題