Comments (3)
To clarify my issue more: When requesting a permission and then choose Don't Allow option, the returned result is 'blocked' but when call check() to get the status it returns denied from what I understand denied status means that it is requestable but it is not
Ah yes, way more clear! This is 100% normal on Android (check the flow)
It's impossible on Android to know if a permission is blocked before requesting it. That's also why check
on PermissionsAndroid
can only resolves a boolean
- but request
can resolve a PermissionStatus
Duplicate: #828 (comment)
from react-native-permissions.
ACCESS_FINE_LOCATION
should be required with ACCESS_COARSE_LOCATION
(using requestMultiple
): https://developer.android.com/develop/sensors-and-location/location/permissions#approximate-request
from react-native-permissions.
@zoontek but this issue also happens with READ_PHONE_STATE
permission
To clarify my issue more: When requesting a permission and then choose Don't Allow
option, the returned result is 'blocked' but when call check()
to get the status it returns denied
from what I understand denied
status means that it is requestable but it is not
Also try this steps on the above code to undrstand the conflict more:
- Make sure in your device settings that the location permission access is
Ask every time
- Open the screen that contains the code, you'll find the status
denied
- Click on
Request location permission
button, the OS alert will appear then chooseDon't Allow
and check your terminal for logs you can search with location permission request result in your terminal, you'll find the logged result isdenied
(which means that it is requestable) - Click on
Request location permission
button again, the OS alert will appear then chooseDon't Allow
again and check your terminal for logs you'll find the logged result isblocked
(which means that it is not requestable) - Kill the app and relaunch it again then go to the screen that contains the code, you'll find the status is
denied
(the output ofcheck()
function) which means that it should be requestable - Click on
Request location permission
button again, no OS alert appears and check your terminal for logs you'll find the logged result isblocked
(which means that it is not requestable) which is logical but thecheck()
function doesn't reflect this
These steps show that request()
and check()
return different statuses for the permission and that I can't rely on check()
to know the correct status of the permission
from react-native-permissions.
Related Issues (20)
- [Android]: Failed to build gradle in monorepo. Unable to resolve react-native location in node_modules HOT 3
- iOS Build failed HOT 2
- After user change setting permission to None. Check permission PERMISSIONS.IOS.PHOTO_LIBRARY / MEDIA_LIBRARY got UNAVAILABLE not DENIED HOT 2
- iOS: check location permission returns 'blocked' when permission is granted but location services are disabled HOT 6
- Cannot read properties of undefined (reading 'iosPermissions') HOT 2
- Syntax Error in Setup? HOT 5
- [Android] App crashed totally after call `request()` function when `minifyEnabled` is `true` HOT 3
- [Android 13-14] App crash at requestNotifications(['alert', 'sound']) HOT 3
- Request APP_TRACKING_TRANSPARENCY always return 'blocked' before user accept request HOT 6
- Notification Permission In Android HOT 3
- I encountered an error message stating 'ENOENT: no such file or directory HOT 4
- AVAudioApplication build fail HOT 3
- Invalid `Podfile` file: undefined method `prepare_react_native_project!' HOT 1
- jest testing: waitForNextUdpate times out on checkPermissions HOT 8
- Unable to detect IOS album permissions HOT 1
- ios.permission.FACE_ID denied HOT 3
- [Android] 'Allow once' permission option always returns granted as permission status even after killing the app and relaunch it again HOT 1
- Crash on Android: Unable to resume activity java.lang.reflect.InvocationTargetException HOT 1
- await request(PERMISSIONS.IOS.PHOTO_LIBRARY); is always unavailable HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-permissions.