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

[Proposal] iOS: deprecate "requestAuthorization" method in favor of "react-native-permissions" #224

Open
Agontuk opened this issue Dec 1, 2020 · 7 comments

Comments

@Agontuk
Copy link
Owner

Agontuk commented Dec 1, 2020

Problem

  • requestAuthorization method handles both whenInUse & always permission request. Since both logic resides in the code, you have to include both NSLocationWhenInUseUsageDescription & NSLocationAlwaysAndWhenInUseUsageDescription in info.plist file, even if you want to use only whenInUse permission. Otherwise app store will reject your app submission, you can find the specific error here iOS App Store Build Missing Purpose String #198
  • There's currently no method available to check current permission status before requesting it.

Benefits of using react-native-permissions

  • RNP handles whenInUse & always permission logic separately, you've to include the one you want in your Podfile.
  • It already exposes a method to check current permission status
  • It already has methods available for precise location introduced in iOS 14.
  • It has unified API for all permissions, both for android & iOS.

Relevant issues

#185
#198
#214

These features can be implemented in this library, but it feels like reinventing the wheels when there's already a good solution available. Let me know what you think.

@fabcall
Copy link

fabcall commented Feb 10, 2021

I personally agree with this. RNPermissions is an amazing library. Dropping requestAuthorization will allow us to focus solely on Geolocation.

@Agontuk
Copy link
Owner Author

Agontuk commented Feb 26, 2021

Right now I think we can print a warning for devs who uses requestAuthorization, telling them to use react-native-permissions. Then in a future major release, we'll drop the method completely.

@EyalPerry
Copy link

EyalPerry commented Apr 13, 2021

adding to the above, app store will also reject your app if you add the always in use flag and not actually use it in your app's code, which is what happened in our case. This creates a loop you can not break out of.

@Andrew-Chen-Wang
Copy link

Just wondering: has anyone tackled this yet?

@Agontuk
Copy link
Owner Author

Agontuk commented Aug 6, 2021

This'll probably be removed in the next major release. Unfortunately I'm quite busy right now with my job, so the major version release will be a bit delayed I think.

@gustavoabel
Copy link

Do you have any update on this?
@Agontuk

@kyadalu1
Copy link

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

No branches or pull requests

6 participants