evollu / evollu/react-native-fcm

presentLocalNotification not playing correct sound

Open
#540 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.7k
Forks
661
PR merge metrics
No merged PRs in 30d

Description

Hi,

first of all, thank you for this library, which is really helpfull.

Usually Android does not show notifications when the App is in foreground (at least on my device). Therefore I use `presentLocalNotification` to display it. For me this is important because my notifications are playing different sounds and this is exacly my problem.

I have bundled a file `bell_1.mp3` into my `/res/raw` directory so when I send a notification and set `sound: 'bell_1'` it plays that sound. However this does not work with `presentLocalNotification`:

```
FCM.presentLocalNotification({
// ...
sound: 'bell-1'
});
```

With the above code the default sound is played.

Any ideas?

---

What version of RN and react-native-fcm are you running?
react-native@0.47.2
react-native-fcm@8.0.0

What device are you using? (e.g iOS9 emulator, Android 6 device)?
Android 7.1.1

Is your app running in foreground, background or not running?
Foreground.

Advanced:
Have you tried adding break point in native handlers to see if message gets delivered?
can share a project with issue?
No.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.