I am using this package: https://github.com/zo0r/react-native-push-notification to schedule local notifications in my react-native app.
I can schedule local notifications that will display when the app is killed or in the background. If the app is in the foreground the visual notification is suppressed but the notification chime sound plays. I don't want the sound to play - as it can only serve to confuse or annoy the user.
According to Apple docs "The system does not display any alerts, badge the app’s icon, or play any sounds when the app is already frontmost." I've been racking my brain and bingeing on docs but I can't figure out what I could have done to circumvent this iOS policy.
Any ideas where I should look in my code?
kOSSettingsKeyInFocusDisplayOption:@(OSNotificationDisplayTypeNone)
to thesettings:@{}
suppress notifications as desired. The default setting according to OneSignal docs is:OSNotificationDisplayTypeInAppAlert - Display an alert with the notification
which seems to have been what was stepping on the iOS notification policies. -- And so it seems this question may not generally be applicable as I don't think many people are mixing multiple notification packages in their app. – Lucas Kellner