服务器向我发送通知中的数据,如下所示:
{ "to" : "xxxxxxxxxx",
"notification":
{
"badge": "1",
"bodyLocArgs": "['XXXX']",
"bodyLocKey": "AAA.BBB.CCC",
"image": "url_image",
"sound": "default"
},
"data": {
"friend": "5dde6ffe47f65624004556d1",
"type": "FRA"
} }
在我的函数中,onMessageReceived我无法获取对象的值"notification",我尝试过,remoteMessage.getNotification().getBody()但它总是给我null,remoteMessage.getData()因为我发现只有"data"“朋友”和“类型”的对象,所以我的问题是如何获取对象"notification"
