1

I need to check if a user was already requested for a permission or not.

What I already know is this:

ContextCompat.checkSelfPermission(activity, ACCESS_FINE_LOCATION)
  • User was never requested: denied
  • User was requested and did not allow: denied
  • User was requested two times and did not allow: denied
  • User was requested and did allow: granted

activity.shouldShowRequestPermissionRationale(ACCESS_FINE_LOCATION)
  • User was never requested: false
  • User was requested and did not allow: true
  • User was requested two times and did not allow: false
  • User was requested and did allow: false

I need to differentiate between "User was never requested" and "User was requested two times and did not allow".

I can't save the count of my requests, because I'm building a plugin. So I can't be sure if the user was already asked by the app.

Is there a way to check if the user was never asked for the permission?

chocolate cake
  • 2,129
  • 5
  • 26
  • 48
  • https://stackoverflow.com/questions/69530502/how-can-we-determine-if-we-can-request-location-permission-upgrade-in-android-12 – blackapps Feb 14 '22 at 09:27

0 Answers0