You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Bug]: Duplicate notifications occur when using an additional SDK, and foregroundWillDisplay does not fire with notifications from sources outside of OneSignal.
#1667
We're using a different package to handle push notifications from our backend. Everything works fine except we can't prevent duplicate notifications from showing when the app is in the foreground. The problem arises because the event listener for foreground notifications
is never fired for push notifications not coming from OneSignal (it is fired for OneSignal notification). However, OneSignal is firing for those notifications:
So notification is visible to the user and there is no any way for us to control it, basically we want to add some logic to skip such notifications.
Steps to reproduce?
1. Install all dependencies and setup OneSignal SDK
2. Send a push notification from different provider (for example Pusher)
What did you expect to happen?
OneSignal should fire foregroundWillDisplay to all push notifications not just OneSignal notifications, or it shouldn't show them when app is in the foreground
React Native OneSignal SDK version
5.1.0
Which platform(s) are affected?
iOS
Android
Relevant log output
1. App is foreground and notification is recieved. Show a alert.
VERBOSE: onesignalUserNotificationCenter:willPresentNotification:withCompletionHandler:
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
Hi @marcin-piela-800 thanks for reaching out! Just to make sure I understand, only the notifications from the other push provider display? If so, that is what I would expect as our methods are meant to handle OneSignal notifications.
I'll look a bit deeper at the logic and see if there is anything we can tweak to handle notifications not coming from OneSignal.
Now, I'm able to prevent notifications (other than OneSignal notifications) from being displayed when the app is in the focused state.
The problem is that it's not default behavior to show all notifications when app is focused, it's added by OneSignal so I would expect to be able to do smth with it using JS code (listener from OneSignal package)
What happened?
Version:
We're using a different package to handle push notifications from our backend. Everything works fine except we can't prevent duplicate notifications from showing when the app is in the foreground. The problem arises because the event listener for foreground notifications
is never fired for push notifications not coming from OneSignal (it is fired for OneSignal notification). However, OneSignal is firing for those notifications:
So notification is visible to the user and there is no any way for us to control it, basically we want to add some logic to skip such notifications.
Steps to reproduce?
What did you expect to happen?
OneSignal should fire
foregroundWillDisplay
to all push notifications not just OneSignal notifications, or it shouldn't show them when app is in the foregroundReact Native OneSignal SDK version
5.1.0
Which platform(s) are affected?
Relevant log output
Code of Conduct
The text was updated successfully, but these errors were encountered: