通过 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 得到普通推送,而不是图像。
我还在使用推送尝试检查 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"
}
我使用推送博客和
[1]:https ://mobisoftinfotech.com/resources/mguide/ios-10-rich-notifications-tutorial/链接富媒体通知。请帮助我如何排序以及我在哪里做错了。
提前谢谢