Git Product home page Git Product logo

Comments (3)

zoontek avatar zoontek commented on June 22, 2024 1

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.

zoontek avatar zoontek commented on June 22, 2024

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.

DaliaElhefny avatar DaliaElhefny commented on June 22, 2024

@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:

  1. Make sure in your device settings that the location permission access is Ask every time
  2. Open the screen that contains the code, you'll find the status denied
  3. Click on Request location permission button, the OS alert will appear then choose Don'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 is denied (which means that it is requestable)
  4. Click on Request location permission button again, the OS alert will appear then choose Don't Allow again and check your terminal for logs you'll find the logged result is blocked (which means that it is not requestable)
  5. 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 of check() function) which means that it should be requestable
  6. Click on Request location permission button again, no OS alert appears and check your terminal for logs you'll find the logged result is blocked (which means that it is not requestable) which is logical but the check() 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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.