简体   繁体   中英

Get Latitude and Longitude from Cellular network in IOS

I am looking to get my Latitude and Longitude from my IOS device when my gps is not on or simply when in the setting the user makes the Location to NEVER.

In android I have done this. Since I am new to IOS development is there any way to find out the latitude and longitude .

Please ask for edit or do it if I have framed the question in a wrong way. Hope I have clearly mentioned the issue.

Any help into this is appreciated.

iOS only has the CLLocationManager available for get the devices location. The CLLocationManager uses all possible method to get the location of the deice. It uses cellular triangulation and only later after it get a GPS fix will it pass these locations to your app.

There is no way to ask CLLocationManager to only use cellular triangulation. You might only get the location based on cellular triangulation and WiFi if you set the desiredAccuracy higher. So you will always need to use the CLLocationManager which requires the users permission.

There is no other way to get the users location in iOS.

If the user does not give the app permission for location, you will not be able to get it from GPS or cellular.

You might be able to get an rough approximation based upon the IP address, but that will be far from precise.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM