我正在使用react-native-push-notification
软件包和PubNub推送通知来处理远程通知。这一切都可以在iOS上正常运行,并且我可以从Android上的onNotification
方法获取通知数据,但是没有像我期望的那样弹出任何实际的通知。我是否想在FCM端缺少配置,还是需要进行特定权限检查以确保可以在android设备上显示远程通知?
我已经按照react-native-push-notification
软件包上的手动步骤操作了T,并三重检查了我没有错过任何东西
答案 0 :(得分:1)
我传递给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上显示通知