How to set notification channel when sending messages via rest api?

痞子三分冷 提交于 2020-02-03 08:44:05

问题


I've been implementing Notification Channels in my android app to support recent android versions.

You can set the notification channel id when sending messages from the firebase web console, but I was not able to find out how to set the channel id when sending messages via fcm rest api.

Notification channels are not mentioned in the reference (https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages), but I am pretty sure there must be a way to set the channel id.


回答1:


The key name I was missing is android_channel_id

I found the key name in the Legacy HTTP Server Protocol docs (https://firebase.google.com/docs/cloud-messaging/http-server-ref)



来源:https://stackoverflow.com/questions/52072135/how-to-set-notification-channel-when-sending-messages-via-rest-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!