简体   繁体   English

React Native Android 远程推送通知未显示

[英]React Native Android remote push notifications not showing up

I am using the react-native-push-notification package and PubNub push notifications to handle the remote notifications.我正在使用react-native-push-notification包和 PubNub 推送通知来处理远程通知。 This all works on iOS just fine and I'm getting the notification data coming in from the onNotification method on android but there is no actual notification popping up on the screen as I would expect.这一切在 iOS 上都可以正常工作,我正在从 android 上的onNotification方法获取通知数据,但没有像我期望的那样在屏幕上弹出实际的通知。 Am I missing a configuration on the FCM side maybe or a specific permission check I need to ask for to make sure remote notifications can be shown on android devices?我是否缺少 FCM 端的配置,或者我需要请求的特定权限检查以确保可以在 android 设备上显示远程通知?

I've followed the manual steps on the react-native-push-notification package to a T and triple checked I didn't miss something我已经按照react-native-push-notification包上的手动步骤进行了 T 和三重检查,我没有错过任何东西

This GCM bit I was passing to Pubnub was this我传递给 Pubnub 的这个 GCM 位是这个

"pn_gcm": {
    "data": {
      "title_for_mobile": "George Washingtons's phone has moved outside of the group",
      "summary_for_mobile": [ "George Washingtons's phone has moved outside of the group" ],
      "data": {
        "action": "radiusTrigger",
        "userId": 6,
        "groupId": 8
      }
    }
  }

and the title_for_mobile wasn't sending it to my phone as a push notification so I had to change it to并且title_for_mobile没有将它作为推送通知发送到我的手机,所以我不得不将其更改为

"pn_gcm": {
    "data": {
      "message": "George Washingtons's phone has moved outside of the group",
      "data": {
        "action": "radiusTrigger",
        "userId": 6,
        "groupId": 8
      }
    }
  }

And now it shows the notification on android现在它在android上显示通知

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM