【问题标题】:Rich notification from FCM does not invoke iOS notification extension (attached image not loading)来自 FCM 的丰富通知不会调用 iOS 通知扩展(未加载附加图像)
【发布时间】:2022-01-16 14:18:51
【问题描述】:

我一直在尝试将推送通知中的图像发送到 iOS 设备。我的推送通知可以发送没有任何错误,但图像没有显示。

到目前为止我所做的尝试:

我可以:

  • 在我的 iPhone 上构建应用程序
  • 使用 Firebase HTTP 端点或 Firebase 控制台向其发送通知
  • 在我的 iPhone 上查看这些通知

我不能:

  • 查看每个通知所附的图片

我的 HTTP 请求如下所示:

curl --request POST \
  --url https://fcm.googleapis.com/v1/projects/${project_name}/messages:send \
  --header 'Authorization: Bearer ${access token}' \
  --header 'Content-Type: application/json' \
  --data '{
   "message":{
      "token":"token",
      "notification":{
         "title":"test notification title",
         "body":"test notification body",
         "image":"https://image_url"
      },
      "apns":{
         "payload":{
            "aps":{
               "mutable-content":1
            }
         },
         "fcm_options":{
            "image":"https://image_url"
         }
      },
      "data":{
         "some_arbitrary_data":"some_arbitrary_data"
      }
   }
}'

我会在这里遗漏什么?

[更新] 问题似乎是我的通知扩展根本没有被调用。

【问题讨论】:

  • 你能在 apple->imageUrl 中看到一个图像值吗?
  • 什么是apple->imageUrl?
  • 它是 ios 远程消息中的图像字段

标签: ios firebase flutter firebase-cloud-messaging


【解决方案1】:

原来是因为我们的 Podfile 中的自定义配置。

【讨论】:

    猜你喜欢
    • 2020-03-24
    • 2018-08-01
    • 2017-07-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-02-24
    • 1970-01-01
    • 2020-02-20
    相关资源
    最近更新 更多