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

[question]: How to hide notifications if on specific screens? #788

Closed
1 task done
Jiehfeng opened this issue Nov 14, 2023 · 1 comment
Closed
1 task done

[question]: How to hide notifications if on specific screens? #788

Jiehfeng opened this issue Nov 14, 2023 · 1 comment

Comments

@Jiehfeng
Copy link

Jiehfeng commented Nov 14, 2023

How can we help?

If say we are in the chat application screens, the expected behaviour is that notifications shouldn't be displayed as the content is already viewed.

How do I hide OneSignal notifications this way? There was an older method called setInFocusDisplayType I believe but I can't find it now since OneSignal.shared is gone.

Code of Conduct

  • I agree to follow this project's Code of Conduct
@emawby
Copy link
Contributor

emawby commented Nov 14, 2023

Hello you are able to use the willDisplayListener and call preventDefault() when you don't want a notification to be displayed. For more migration details you can check out our documentation here.

@emawby emawby closed this as completed Nov 14, 2023
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

2 participants