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.
To create a notification channel, follow these steps: Construct a NotificationChannel object with a unique channel ID, a user-visible name, and an importance level. Optionally, specify the description that the user sees in the system settings with setDescription() .
Android Push Notification Channels were introduced in Android Oreo (Android 8.0 / API Level 26) to provide a unified system to help users manage their notifications.
Starting with Android 8.0, apps are required to assign their notifications to so-called “notification channels”. These channels determine which signals (notification sound, light, vibration, etc.) incoming notifications trigger.
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With