5

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.

linnedude
  • 161
  • 1
  • 6

1 Answers1

11

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)

linnedude
  • 161
  • 1
  • 6
  • Thanks dear, but this solution did not work for me. Thanks again. – Kamlesh Sep 05 '21 at 16:28
  • FYI, when actually sending a message, the parameter name needs to be "channel_id": Example : android: { notification: { title:title, body: message, channel_id:'high_importance_channel' } }, – mike hennessy Oct 13 '21 at 14:26