-
Notifications
You must be signed in to change notification settings - Fork 368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: INotificationLifecycleListener can't prevent display of notification from INotificationServiceExtension #2057
Comments
@AlanMTuring could you let us know where you are calling
If the above is correct, can you confirm |
We pass the I added verbose logging via OneSignal and also added two small logs of my own. I launched our app, navigated to the screen that has the The lifecycle listener is getting added:
and this confirms that the
and the notification is still coming through. Happy to share any other info! |
Any updates here? Does this look like a OneSignal issue or an issue on our end, with setup or something else? |
How can we help?
How do I properly NOT display a notification on a specific screen?
event.preventDefault()
is not working.Our app is implementing an
INotificationServiceExtension
and in theonNotificationReceived
function we decrpyt the message, update the notification, and callevent.display()
.On a the screen in our app where the notification would normally take the user, I'm using the
INotificationWillDisplayEvent
in theINotificationLifecycleListener.onWillDisplay
to callpreventDefault
so that the notification would not display, but the notification always displays. I'm assuming this is because we're calling.display()
from the service extension, but I don't know how to get around that.Am I doing something wrong in the implementation? or is this a bug and should I create a bug issue?
The code is using version 5.1.8 of the SDK.
Here is the code from the Service Extension. Confirmed that this is successfully decrypting the message and showing the proper notification.
Here is the code from the screen that should be hiding the notification, but confirmed is not working.
Code of Conduct
The text was updated successfully, but these errors were encountered: