我已經爲推送通知消息遷移gcm to fcm
。 但是我如何從RemoteMessage獲取bundle數據,並接收onMesssageReceived方法。從FCM的RemoteMessage獲取onMessageReceived方法的值
Old GCM give bundle data onMessageReceiced method but in FCM there is RemoteMessage data.
那麼請告訴我如何解析remotemessage以獲取所有通知值。
MY PAYROL
{
"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"
]
}
感謝您的回答,但我的其他數據下的通知對象不在數據對象中,那麼我怎樣才能得到它 –
正如你已經在評論中提到,你會從remoteMessage得到你的結果。得到通知()。你能試試嗎.. –