![](/img/trans.png)
[英]Remote Push Notifications in React Native for both Android and IOS
[英]React Native Android remote push notifications not showing up
我正在使用react-native-push-notification
包和 PubNub 推送通知来处理远程通知。 这一切在 iOS 上都可以正常工作,我正在从 android 上的onNotification
方法获取通知数据,但没有像我期望的那样在屏幕上弹出实际的通知。 我是否缺少 FCM 端的配置,或者我需要请求的特定权限检查以确保可以在 android 设备上显示远程通知?
我已经按照react-native-push-notification
包上的手动步骤进行了 T 和三重检查,我没有错过任何东西
我传递给 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
}
}
}
并且title_for_mobile
没有将它作为推送通知发送到我的手机,所以我不得不将其更改为
"pn_gcm": {
"data": {
"message": "George Washingtons's phone has moved outside of the group",
"data": {
"action": "radiusTrigger",
"userId": 6,
"groupId": 8
}
}
}
现在它在android上显示通知
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.