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

How to check if notification is enabled on Android #235

Closed
vincent-paing opened this issue Nov 17, 2021 · 2 comments
Closed

How to check if notification is enabled on Android #235

vincent-paing opened this issue Nov 17, 2021 · 2 comments

Comments

@vincent-paing
Copy link
Contributor

in iOS, we can check with getNotificationSettings and use the authorizationStatus attribute. Is there an equivalent for Android?

@helenaford
Copy link
Member

Hey, good question 🤔 You can check on a channel level using isChannelBlocked but if you need to check on an app level, it looks like we don't have that.

I believe you're the first person to ask for this, so will mark it as a feature request 😎

However, by default when the app is initially installed, notifications are enabled, and you can listen to events to track when the user has disabled them here

You can also use react-native-permission as they have a function checkNotifications which will let you know on an app level if a used has turned them off.

Hope that helps!

@vincent-paing
Copy link
Contributor Author

vincent-paing commented Nov 18, 2021

I noticed the way the other lib does is by playing with alert flag for android app level. See this PR for example. I could submit a PR similar to that one if we could do the same with alert flag. Or do you have an idea on how it should be in mind?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants