【问题标题】:Flutter IOS firebase_message only work in firebase consoleFlutter IOS firebase_message 仅适用于 firebase 控制台
【发布时间】: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


    【解决方案1】:

    我刚刚解决了添加

    FirebaseAppDelegateProxyEnabled = YES

    在 info.plist 中

    Not Receiving push notifications from firebase

    【讨论】:

      猜你喜欢
      • 2018-12-15
      • 2022-01-25
      • 2017-10-01
      • 2018-11-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-01-14
      • 2014-09-21
      相关资源
      最近更新 更多