通过firebase发送通知时,不会触发通知服务扩展。它将显示没有图像的常规通知。
我必须发送的确切有效载荷是多少。
我已经试过这个负载了:
{ to = fedAu7oCO78:APA91bFAdcwctoVVcj-KtfQwD5hdBN7shcgw9QRgh-xQoLlKgBptqG2fxSYmL9T73BY5yOi81OOFbUVoZJp8b4hwPTCxvK4ZvR6hek, content_available = True, mutable_content = True, notification = { icon = myicon, badge = 1, sound = default, body = testing, title = iostest, NotificationImage = https://NotificationImage/822cf50ae5944995a033c51bf1c857a3banner1.jpg}, data = { mediaUrl = https://www.manijewel.com/NotificationImage/822cf50ae5944995a033c51bf1c857a3banner1.jpg },
priority = high, time_to_live = 6000 }或
{
"to": "dWB537Nz1GA:APA91bHIjJ5....",
"data":
{
"message": "Offer!",
"mediaUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/2/2a/FloorGoban.JPG/1024px-FloorGoban.JPG"
},
"notification":
{
"body": "Enter your message",
"sound": "default",
"content-available": 1,
"mutable-content": 1
}
}我得到了这个:
我正在为我的项目使用FCM。它对一个类型有丰富推送通知。我尝试修改了从FCM获取推送的大多数可能的方式。我只得到了来自FCM的普通推送,没有图像。
我也在用push try检查APNS的相同编码。我得到了推送通知的预期设计。
这里是ios端的有效负载
{
"aps": {
"alert": "Enter your message",
"badge": 1,
"sound": "default",
"content-available": 1,
"mutable-content": 1
},
"mediaUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/2/2a/FloorGoban.JPG/1024px-FloorGoban.JPG"
}我使用pusher博客
1:链接富媒体的https://mobisoftinfotech.com/resources/mguide/ios-10-rich-notifications-tutorial/ notification.Please帮助我如何对此进行排序以及我哪里做错了。
提前感谢
发布于 2017-07-06 16:15:19
负载格式应如下所示:
{
"to": "dWB537Nz1GA:APA91bHIjJ5....",
"content_available": true,
"mutable_content": true,
"data":
{
"message": "Offer!",
"mediaUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/2/2a/FloorGoban.JPG/1024px-FloorGoban.JPG"
},
"notification":
{
"body": "Enter your message",
"sound": "default"
}
}https://stackoverflow.com/questions/44943169
复制相似问题