Open ZoroYouth opened 5 years ago
Step 1: Create Notification Channel In APP. Step 2: Pass this channel id to notification
"notification" :
{
"body" : "This is a Firebase Cloud Messaging",
"title" : "FCM Message",
"sound":"custom",
"android_channel_id":"channel id"
}
My custom ringtone is invalid. I wonder if it is because the android version is too high. Server code: "notification" : { "body" : "This is a Firebase Cloud Messaging", "title" : "FCM Message", "sound":"play", "channel_id":"channel id" } android code(res/raw/play.mp3):
expect: The MP3 player,But it didn't work
The push message is like
And the custom.mp3 is in /res/raw It works fine when my project target api 23, but it does not work when target api 26 on Android O. Both target api 23 and target api 26, the notifications are shown by the system if the app is in background. I don't know what has changed on Android O. I don't want to change the notification message to data message on the server side because it affects a lot. Is there an easy way to solve the issue? Thanks.