click here to check postman request
在将GCM迁移到FCM时,我在GCM请求正文的请求正文中使用了aps参数,但在为FCM尝试相同时,它显示了InvalidParameters。
网址:https://fcm.googleapis.com/fcm/send
请求:
{
"notification": {
"title": "notification title",
"body": "message body changed 11"
},
"data": {
"mt": "re",
"offerid": "10562",
"aps":{"badge":0,"alert":"gauravtest,$20 OFF COUPON","sound":"null.caf"},
"clpnid": "xxx",
"custid": "xxx",
"eoid": "0",
"pc": "171-2802-8180",
"ed": "11/08/2017",
"ag": "",
"url": "",
"previewimage": ""
},
"to": "xxxx"
}
响应:
{
"multicast_id": 6282546760147817634,
"success": 0,
"failure": 1,
"canonical_ids": 0,
"results": [
{
"error": "InvalidParameters"
}
]
}
答案 0 :(得分:0)
出于某种原因,在将aps
对象与data
对象组合时,不允许使用notification
参数。
如果删除notification
对象,邮件将成功发送,但您将发送data push message而不是通知推送消息。
答案 1 :(得分:0)
//简单易用,您已经收到推送请求并且可以使用其他参数
"notification": {
"title": "notification title",
"body": "message body changed 11"
"content_available": true,
"extraParameter_1": "any kind of data ",
"extraParameter_2": "any kind of data 2"
}