2017-12-19 16 views

답변

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.