Skip to content
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]: preventDefault notification displayed on app restarted #1039

Open
2 of 3 tasks
spiderciccio opened this issue Jan 26, 2025 · 0 comments
Open
2 of 3 tasks

[Bug]: preventDefault notification displayed on app restarted #1039

spiderciccio opened this issue Jan 26, 2025 · 0 comments

Comments

@spiderciccio
Copy link

What happened?

I notice after use event.preventDefault() inside foregroundWillDisplay listener, when I close and restart the app, the notification will display again

Steps to reproduce?

1. use preventDefault inside foregroundWillDisplay listener
2. close the app and reopen
3. wait few second, the notification will appear again

What did you expect to happen?

on step 3 I don't expect notification because I used preventDefault inside foregroundWillDisplay listener

OneSignal Cordova SDK version

5.2.9

Which platform(s) are affected?

  • iOS
  • Android

Relevant log output

I found how to fix it, inside src/android/com/onesignal/cordova/OneSignalPush.java

in the function preventDefault
replace 'event.preventDefault();' with 'event.preventDefault(true);'

Code of Conduct

  • I agree to follow this project's Code of Conduct
@spiderciccio spiderciccio changed the title [Bug]: notification displayed on app restarted [Bug]: preventDefault notification displayed on app restarted Jan 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant