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

时间:2017-04-09 04:58:48

标签: 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"
}

1 个答案:

答案 0 :(得分:3)

没有。您在icon参数中指定的图标需要是APK中已存在的图片资源。

  

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

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