【发布时间】:2020-09-25 10:00:19
【问题描述】:
我已经使用带有 firebase_message 插件的 Flutter 开发了跨平台应用程序。 它在 android 系统中运行良好,但在 IOS 中部分推送通知不起作用
当我尝试从 firebase 控制台 web 向所有 IOS 设备发送推送通知时,它运行良好
但如果我尝试使用 POST 方法发送
<header start>
Authorization : <Firebase server key>
<header end>
{
"collapse_key" : "type_a",
"priority" : "high",
"notification" : {
"body" : "bd",
"title": "tt",
"android_channel_id": "noti_push_NEW_PLAY"
"sound": "NEW_MESSAGE.wav"
},
"data" : {
"click_action": "FLUTTER_NOTIFICATION_CLICK"
"type": "NEW_MESSAGE",
},
"apns": {
"payload": {
"aps": {
"sound": "NEW_MESSAGE.wav",
}
}
},
"to" : <token>,
}
推送通知在 IOS 中不起作用并出现错误 NotRegistered
{
"multicast_id": <returned id>,
"success": 0,
"failure": 1,
"canonical_ids": 0,
"results": [
{
"error": "NotRegistered"
}
]
}
我认为这与设置无关,因为我可以从 firebase Web 控制台向所有 IOS 设备发送推送消息。但如果我尝试将它发送到特定设备,我不能。
我遵循了所有步骤 firebase 设置、APN 证书、Apple id、添加 Xcode 推送通知功能等...
什么问题???
谢谢
【问题讨论】:
标签: ios firebase flutter push-notification apple-push-notifications