evollu / react-native-fcm

react native module for firebase cloud messaging and local notification

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cant able to change sound and update badge count in android?

saikiranoptisol opened this issue · comments

I have gone through most of the issues, still the solution that i need is cant able to get. As per my requirement in payload we are sending a sound param. below is the payload that is sending to me
message ={
to:to,
badge : count,
"notification" : {
"body" : body,
"icon" : "ic_launcher",
"sound": "blank.mp3",
"badge": count
},
"data" : {
"body" : body,
"icon" : "ic_launcher",
"sound": "blank.mp3",
"badge": count
},
}

what ever the sound name i mention. it is displaying only default sound in Android. in IOS both the sound and badge count update works fine. As per the doccument for android we need to use custom_notification. I tried even that.
message = {
data:{
custom_notification:{
"body" : body,
"icon" : "ic_launcher",
"sound": "blank.mp3",
"badge": count
}
}
}.

if i try like this. in foreground i can able to receive notification but not notification banner. log is printing when i receive notification. but in background and killed state nothing happening. Kindly help i struck with sound change from a long time.
Note : i have added my sound file raw folder correctly.