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

On android checkNotifications and requestNotifications result in denied #382

Closed
vvusts opened this issue Dec 4, 2019 · 4 comments
Closed
Labels
bug Something isn't working

Comments

@vvusts
Copy link

vvusts commented Dec 4, 2019

On android 8 when I install app, permission for notifications is given already.
I disable it in settings and I have check:
checkNotifications().then(({status, settings}) => { // this return status 'denied'
on denied I show screen with following event:

let permitted = await requestNotifications();
   if (permitted.status === 'granted') {

But this code do nothing.
Permission dialog not displayed.
Value of permitted.status is denied.
On IOS work fine. This doesn't work on android.
I didn't add [alert, sound] as I see comment in documentation that it's only for ios.
What is wrong?

@mikehardy
Copy link

I recommend you integrate react-native-permissions and check or request with it. Maybe the permission is actually blocked meaning the pop-up will not open again, I know that module handles that case and (more importantly) ios13 cases as well

@zoontek zoontek added the bug Something isn't working label Dec 4, 2019
@zoontek
Copy link
Owner

zoontek commented Dec 4, 2019

This is indeed a small bug. As it's impossible to request notifications permission on Android, the returned value should be blocked here https://github.com/react-native-community/react-native-permissions/blob/master/android/src/main/java/com/reactnativecommunity/rnpermissions/RNPermissionsModule.java#L98

I will fix this soon 🙂

@vvusts
Copy link
Author

vvusts commented Dec 4, 2019

I read in a few other issues that notification permission is not requestable on android?

On ios this check is fine if not requested I get RESULTS.DENIED if denied I get RESULTS.BLOCKED.
But on android I always get RESULTS.DENIED and in app I have somehow different flow based on permission.
I need to know if RESULTS.BLOCKED work on android so I change my flow in app.

Sorry @zoontek I didn't see your replay. So it will not be possible to request permission but BLOCKED will work?

@zoontek zoontek closed this as completed in 4bd27ed Dec 4, 2019
@zoontek
Copy link
Owner

zoontek commented Dec 4, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants