-
Notifications
You must be signed in to change notification settings - Fork 379
Open
Labels
Description
What happened?
I would like to not display notification if some conditions are met.
Regarding to the [User Model] Rename Events & API Changes pull request:
OneSignal.Notifications.addEventListener('foregroundWillDisplay', (event) => {
event.preventDefault();
// async work
event.getNotifications.display();
};
In the previous versions this could to achived by calling notificationReceivedEvent.complete(undefined)
Steps to reproduce?
1. Install react-native-onesignal 5.0.2
2. Build and run iOS
3. Subscribe user to the push notifications with OneSignal SDK
4. Add foregroundWillDisplay event listener and comment `event.getNotifications.display()`
5. Send test notification
6. The notification is displayed but should be hiddenWhat did you expect to happen?
I would like to not display notification if some conditions are met.
React Native OneSignal SDK version
5.0.2
Which platform(s) are affected?
- iOS
- Android
Relevant log output
No response
Code of Conduct
- I agree to follow this project's Code of Conduct