【发布时间】:2016-07-07 11:29:41
【问题描述】:
我已迁移 gcm to fcm 以获取推送通知消息。
但是我如何从接收到的远程消息中获取捆绑数据的 onMesssageReceived 方法。
Old GCM give bundle data onMessageReceiced method but in FCM there is RemoteMessage data.
所以请告诉我如何解析远程消息以获取通知的所有值。
我的工资单
{
"collapse_key":"score_update",
"priority":"high",
"content_available":true,
"time_to_live":108,
"delay_while_idle":true,
"data":
{
"message": "Message for new task",
"time": "6/27/2016 5:24:28 PM"
},
"notification": {
"sound": "simpleSound.wav",
"badge": "6",
"title": "Test app",
"icon": "myicon",
"body": "hello 6 app",
"notification_id" : "1140",
"notification_type" : 1,
"notification_message" : "TEST MESSAGE",
"notification_title" : "APP"
},
"registration_ids": ["cRz9SJ-gGuo:APA91bFJPX7_d07AR7zY6m9khQro81GmSX-7iXPUaHqqcOT0xNTVsOZ4M1aPtoVloLNq71-aWrMCpIDmX4NhMeDIc08txi6Vc1mht56MItuVDdA4VWrnN2iDwCE8k69-V8eUVeK5ISer"
]
}
【问题讨论】:
-
此链接可能对您有所帮助:stackoverflow.com/a/56231468/7254873
标签: java android google-cloud-messaging android-notifications firebase-cloud-messaging