We're trying to migrate from silent FCM pushes to loud ones (i.e. from "data":{}
managed by the app, to those that "notification": {}
causes).
With loud push, FCM client framework automatically creates a notification. Therefore:
onRemoteMessage()
but the auto generated notification plays the default beep, which will cause a funny playing of both sounds.How can I solve those issues?
Thanks
In case of notification payload when FCM client framework automatically creates a notification using notification payload data. Notification payload contains a key for sound so you have to set it from server side.
For Example :
{
"to" : "yourToken",
"notification" : {
"body" : "Notification Body",
"title" : "Notification Title",
"sound" : "/res/raw/yourSoundResourceFile"
}
}
As per as firebase documentation sound is a Optional string
Supports "default" or the filename of a sound resource bundled in the app. Sound files must reside in /res/raw/.
For more info follow this offical firebase link