[英]Firebase Cloud Messaging (FCM) not getting data
I'm sending push notification using FCM to Android device. 我正在使用FCM向Android设备发送推送通知。
I'm using java based google API client for sending messages. 我正在使用基于Java的Google API客户端发送消息。
FCM request body for message using common notification object: 使用公共通知对象的FCM请求正文消息:
{
"message": {
"notification": {
"title": "FCM Notification",
"body": "Notification from FCM"
},
"data": {
"k1": "v1",
"k2": "v2"
},
"token": "eeNFUXuDQ:APA91bGaLh5UeJcyJctFWlvC32ezPk7ZWp-D05ImpPWbSv_yc49igOioyBOMZg3bxl8L8fvNWTQW6LcptwZoiOwHtIN24uNHox1s2ql1Ir5Rm9Jk1DXPAPe79o20GXHZhY04-TRzpaXe"
}
}
Message sent to Firebase for delivery, response: 邮件已发送到Firebase进行传递,回复:
{
"name": "projects/lacoya-1540956670279/messages/0:1544690320409950%b4fb2744b4fb2744"
}
But, in my android device, I'm getting only title value "FCM Notification"
as a notification but I want to see some data as well like some custom JSON. 但是,在我的android设备中,我仅获得标题值
"FCM Notification"
作为通知,但我想查看一些数据以及一些自定义JSON。
Please through some light if you face this earlier. 如果您早些时候遇到这个问题,请通过一些光线。
Regards, 问候,
There was some some problem with android code. android代码存在一些问题。 After using correct callback method, we are getting data.
使用正确的回调方法后,我们正在获取数据。 Below is the useful link.
以下是有用的链接。
https://firebase.google.com/docs/cloud-messaging/android/receive https://firebase.google.com/docs/cloud-messaging/android/receive
Thanks for all of your efforts. 感谢您的所有努力。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.