Firebase 云消息传递的动态通知图标

Aka*_*han 6 android firebase firebase-cloud-messaging

我正在使用 Google Firebase 云消息传递 (FCM)。FCM 将通知图标作为应用程序图标发送。我想从 URL 发送动态图标,但它不起作用。是否可以发送动态通知图标?

{
  "notification":{
    "title":"App Title",  
    "body":"descriptions",
    "icon":"http://example.com/abc.png",
    "click_action":"FCM_PLUGIN_ACTIVITY"
  },
  "data":{
    "state":"contact",  
    "param2":"value2"
  },
    "to":"/topics/all",
    "priority":"high"
}
Run Code Online (Sandbox Code Playgroud)

Die*_*ini 4

否。您在参数中指定的图标icon必须是 APK 中已存在的图像资源。

iconmyicon将可绘制资源的 通知图标设置为myicon。如果您不在请求中发送此密钥,FCM 将显示应用程序清单中指定的启动器图标。

https://firebase.google.com/docs/cloud-messaging/http-server-ref#notification-payload-support