Flutter IOS firebase_message仅在firebase控制台中工作

问题描述 投票:0回答:1

我已经使用带有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中不起作用,错误未注册

{
    "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
1个回答
0
投票

我已经解决了添加问题

FirebaseAppDelegateProxyEnabled =是

在info.plist中

Not Receiving push notifications from firebase

© www.soinside.com 2019 - 2024. All rights reserved.