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

Is there a way of getting result of permission request made by getCurrentPosition or requestAuthorization? (IOS)

Open ardatumay opened this issue 4 years ago • 6 comments

Hello, When app is first installed and location permissions is not given by the user, calling getCurrentPosition first requests permission from user and then, without waiting result of user permission, returns the position. However, if user gives permission little bit late which is later than return of this method, this method returns error as current position. But user already give the permission. So I need to wait for user to finished her/his interaction with permission dialog. How to do this?

Another problem: When requestPermission method is called, it requests a permission but never returns the result of permission dialog when user presses one of the options. How to know whether user give the permission or not?

All questions is for ios.

Thanks for any suggestion.

ardatumay avatar Mar 27 '21 10:03 ardatumay

+1

longb1997 avatar Mar 30 '21 06:03 longb1997

+1

ioitiki avatar Jun 19 '21 01:06 ioitiki

+1

androidfanatic avatar Jun 22 '21 15:06 androidfanatic

@androidfanatic

I was able to solve this using the more recently maintained drop in replacement for this package.

'react-native-geolocation-service'

hope this helps :D

ioitiki avatar Jun 22 '21 16:06 ioitiki

@ioitiki I did the exact same thing after struggling for an hour! Cheers.

Link for the lazy: https://github.com/Agontuk/react-native-geolocation-service

androidfanatic avatar Jun 23 '21 11:06 androidfanatic