相关疑难解决方法(0)

从FCM onMessageReceived方法获取RemoteMessage的值

我有迁移gcm to fcm推送通知消息.但我如何从RemoteMessage获取捆绑数据收到onMesssageReceived方法.

Old GCM give bundle data onMessageReceiced method but in FCM there is RemoteMessage data.
Run Code Online (Sandbox Code Playgroud)

所以请告诉我如何解析remotemessage获取所有通知值.

我的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"
]
}
Run Code Online (Sandbox Code Playgroud)

java android android-notifications google-cloud-messaging firebase-cloud-messaging

22
推荐指数
2
解决办法
4万
查看次数