首页 > 解决方案 > 通过rest api发送消息时如何设置通知通道?

问题描述

我一直在我的 android 应用程序中实现通知通道以支持最新的 android 版本。

您可以在从 Firebase Web 控制台发送消息时设置通知通道 id,但我无法找到在通过 fcm rest api 发送消息时如何设置通道 id。

参考( https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages )中没有提到通知通道,但我很确定必须有一种方法来设置通道 ID。

标签: firebasefirebase-cloud-messagingnotification-channel

解决方案


我缺少的键名是android_channel_id

我在Legacy HTTP Server Protocol 文档( https://firebase.google.com/docs/cloud-messaging/http-server-ref )中找到了密钥名称


推荐阅读