-
Notifications
You must be signed in to change notification settings - Fork 678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom sound for FCM notifications #565
Comments
it is certainly doable. put the sound file in your project and use |
in res/raw/ i saw but impossible to play it... |
set break point here and see if your resouceId is set |
Oh thanks! But how to put a break point with react-native? Thanks :) |
I use Android Studio. |
Oh alright, can you update the exemple in the repo and put a sound that works for you? |
updated |
Hi @evollu Does this work for remote notifications pushed from firebase console? Because I added the .mp3 file in raw folder, but I'm not sure of how to construct the notification payload on firebase console.. I've tried adding |
@crHand I'm not sure. ask Firebase team? |
@yolosaucisson any updates? |
Dear evollu i tried to find raw folder but that doesn't exist. I created my own raw folder 'android/app/src/main/res/raw/sound.mp3'. but still sound is not playing i tried with default keyword but default sound is also not playing. I'm using current version |
if 'default' doesn't work, mostly likely it has to do with some of your phone setting. try a different device or emulator |
Hey Evollu thanks for giving me the direction. I just check my sound setting and there notification level was on 0 mean it was mute. After increasing notification volume i'm able to listen sound Thanks for the help |
Hello everyone. How to solve? |
How to Custom sound for FCM IOS ? @evollu |
@i3IGm you drag an mp3 file into xcode project, e.g. then in your notification payload you put there is a working example in example project |
@evollu I'm trying to send clevertap push notification with custom sound. I have added the sound files to the below path "/Users/Per/ProjectNa/android/app/src/main/res" of react native android project. Notification with default sound is working but trying to the send the notification with custom sound (eg:alarm_sound.mp3) is not playing the sound. I'm receiving the notification without sound. Not sure what is happening. Please let me know where i am going wrong. |
@DurgaManickam what's your payload |
@evollu I've added the file in
But still not working. |
@evollu I'm also experiencing the same issue. I have sound: 'notification.mp3' in my payload. This worked when using react-native-push-notification, but I can't use that library any longer as it broke after I upgraded to SDK 27. I've used custom channels, custom_notification, every combination of payloads, and nothing is working. I've also tried without .mp3. This is my received payload:
|
@evollu This is a good reference: https://stackoverflow.com/questions/50567164/custom-notification-sound-not-working-in-oreo |
Hi Guys, |
@manoj2166 Thank you so much, this works perfectly for me! |
not working to me, android - sharp aquos s2 |
Can you please share your request payload? |
@95deepan Here's the payload that is sent from our PHP backend: Please note that the custom sound and On Android for show in foreground to work I had to capture the notification event and display a custom modal to show the information to user, then use |
@phatlaunchdeck actually in my case I am able to play the custom sound via some sound-player library by identifying the data from payload. But when the app is closed or running in background, then I am not able to get the custom sound. For few devices default notification sound is coming and for few no sound is coming at all. |
@95deepan Yeah it's the same for me on Android too, such a big headache, I even tried to modify the native code of this library but no luck so far |
How come slack and many other apps are throwing notifications with custom sound? Unlike one time sound configuration, in those apps we can even change those sounds whenever needed after installing the app. How that is possible? |
@95deepan I believe those were built with native code instead of React Native |
@phatlaunchdeck Yeah they might be built with native code. Can't we have the same in react-native-fcm, since we can see 60% of java code below here 👇 . |
I'm having trouble playing a custom sound on Android too. I'm using What I've tried so far:
What am I missing here? If the firebase messaging library doesn't support a custom sound with this version (7.*) would be great to get that clarified. Thanks Cc: @evollu |
Hi,
I would like to know if someone made a custom sound when received?
Sincerely,
The text was updated successfully, but these errors were encountered: