Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get user's current location without asking for permission?

can any one tell me how can i get the current location-latitude/longitude info of the user without asking his permission? Like getting user's location automatically? Thanks in Advance. Shreya

like image 719
Shreya Avatar asked Dec 27 '22 10:12

Shreya


2 Answers

From apple's documentation

Important: In addition to hardware not being available, the user has the option of denying an application’s access to location service data. During its initial uses by an application, the Core Location framework prompts the user to confirm that using the location service is acceptable. If the user denies the request, the CLLocationManager object reports an appropriate error to its delegate during future requests. You can also check the application’s explicit authorization status using the authorizationStatus method.

So apple wont allow to use CoreLocation framework without user's permission. I don't thing there is no other way without using CoreLocation framework, atleast with public API..

like image 84
Krishnabhadra Avatar answered Jan 12 '23 01:01

Krishnabhadra


I wouldn't recommend trying to get around Apple's TOS regarding getting user's permission to enable CoreLocation for an app. It seems like a sure fire way to get your app rejected. Apple may be sensitive about this kind of stuff.

Here's a related question I found.

like image 36
Michael Dautermann Avatar answered Jan 12 '23 00:01

Michael Dautermann