invertase / react-native-notifee

Moved to https://github.com/invertase/notifee
https://invertase.io/blog/open-sourcing-notifee
Other
465 stars 31 forks source link

[iOS] Notification sound does not stop on cancelNotification()/cancelDisplayedNotification() #384

Closed marcjulianfleck closed 3 years ago

marcjulianfleck commented 3 years ago

If I trigger a notification on iOS from the setBackgroundMessageHandler() of Firebase with a custom sound - which is around 25 seconds - and after some time call notifee.cancelNotification("OWN_ID") or notifee.cancelDisplayedNotification("OWN_ID") the notification gets removed. However, the sound keeps playing till the end. On the other hand, if I press on the notification, the sound stops immediately.

This is how I display/start the notification:

notifee.displayNotification({
    id: "OWN_ID",
    title: "SOME_TITLE",
    body: ""SOME_BODY",
    ios: {
      sound: "customSound.mp3"
    }
});

Anybody solved this issue yet?

mikehardy commented 3 years ago

A quick search on this one indicates it may have different behavior depending on whether it is the simulator or a real device, and varying on iOS versions

@marcjulianfleck - can you specify the exact testing environment (versions, real device or simulator) when you see this behavior?

https://stackoverflow.com/questions/19540516/how-stop-local-notification-sound-after-cancel-local-notification https://stackoverflow.com/questions/4762816/is-it-possible-to-stop-the-sound-of-a-uilocalnotification-from-playing-when-the/27238910#27238910

marcjulianfleck commented 3 years ago

@mikehardy yes, I already saw a few similar issues on stackoverflow. However, it seems not be fixed after iOS 8.0 in my case.

My environment:

helenaford commented 3 years ago

Mmm interesting, I think this is out of our control 😕