react-native-geolocation icon indicating copy to clipboard operation
react-native-geolocation copied to clipboard

Deprecate and remove "requestAuthorization"

Open matt-oakes opened this issue 5 years ago • 2 comments

Ask your Question

We should deprecate and remove the requestAuthorization method from this library. This is currently a broken implementation as it does not allow you to specific what level of permissions you would like on iOS and doesn't do anything at all on Android.

I think that we should instead be asking users to use a dedicated API for managing permissions. react-native-permissions is a good example, but really React Native should have a cross platform API for this builtin, rather than just supporting Android through PermissionsAndroid.

matt-oakes avatar Apr 02 '19 18:04 matt-oakes

@matt-oakes do not agree that we need to remove the authorization. Yes you can use react-native-permissions which is great to do a check on forehand but I do not think you can do without it in the geolocation library because you need to have a status of the authorization anyway if a request to the api fails. You want to give back a good error message. Also when using a native geo api on iOS for example it will popup the message anyway and we need to take care of this scenario as wel in my opinion. We see the same with react-native-camera which has the authorization build in; as it should be in my opinion

wbroek avatar Apr 04 '19 07:04 wbroek

Maybe you could go the same route as react native permission and provide a cocoa pods config that excludes the permission request, to let people use their preferred permission solution without requiring to add string to the Info plist for unrequested permission.

MrLoh avatar Oct 26 '19 16:10 MrLoh