2017-10-25 1 views
0

zo0r/react-native-push-notification에 RN 0.43을 사용하고 있습니다.React Native - 기기가 잠겨있을 때 푸시 알림을 수신하지 않습니다.

기기가 잠겨 있지 않은 한 모든 것이 올바르게 작동합니다. 여러 번 시도하고 여러 번 시도했지만 작동했으나 일부 변경된 경우 장치가 잠긴 상태에서 알림을받지 못합니다.

내 설정이다 :

PushNotification.configure({ 
    onRegister: function(token) { 
     UserStore.storeDeviceToken(token) 
    }, 

    onNotification: function(notification) { 
     if (notification) { 
      PushHandler.notificationReceived(notification) 
     } 
    }, 

    permissions: { 
     alert: true, 
     badge: true, 
     sound: true 
    }, 

    popInitialNotification: true, 
    userInteraction: true, 
    requestPermissions: true 
}) 

답변

1

서버에서 알림을 보낼 때 당신은 motification 페이로드에 mecessary 값으로 키를 다음 제공해야합니다

{ 
"content_available": true, 
"priority":"high", 
"show_in_foreground": true 
...other_data 
} 
관련 문제