![](/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.