【问题标题】:Firebase messaging data comes to Android but not IOSFirebase 消息传递数据来自 Android,而不是 IOS
【发布时间】:2021-08-06 15:56:45
【问题描述】:

在我的 Flutter 应用中,当我使用 Postman 发送推送通知时,数据会发送到我的 Android 测试设备,

{notification: {title: MugSafe Powerbank Sizi Bekliyor, body: Hemen alışverişe başlayın}, 
data: {priority: high, data1: helloworld, click_action: FLUTTER_NOTIFICATION_CLICK, 
content_available: true}}

但它不会出现在 Ios 模拟器或真实设备甚至 logcat 中。

它在 Android 中根据需要工作,但在 Ios 中没有

我应该在 Xcode 中为这个问题做些什么吗?

我的帖子;

{
"to":"devicetoken",

 "notification": { 
    "body": "Hemen alışverişe başlayın",
    "title": "MugSafe Powerbank Sizi Bekliyor",
    "sound":"default",
    "sound2":"default",
    "click_action": "FLUTTER_NOTIFICATION_CLICK"

  },
  "data": {
    
   
    "data1":"helloworld"
   
  },
 "content_available": true,
    "priority": "high"
}

【问题讨论】:

  • 当我们在你的 iOS 应用上看不到获取通知的代码时,很难提供洞察力;你能提供吗?

标签: ios firebase flutter dart push-notification


【解决方案1】:

这里是一个链接,其中解释了 iOS 的云消息传递设置 (https://firebase.flutter.dev/docs/messaging/apple-integration)。完成此处提到的所有操作后,它应该可以按预期工作!

注意:Apple 的模拟器不支持通知!

【讨论】:

    猜你喜欢
    • 2016-09-22
    • 1970-01-01
    • 2020-10-21
    • 2019-07-12
    • 2017-05-05
    • 2020-10-19
    • 2020-04-12
    • 2020-07-10
    • 1970-01-01
    相关资源
    最近更新 更多