Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

get location on iphone ONLY from the GPS - not the wifi network

i am creating an app that uses location-

everything works swimmingly except one thing-

when i come home my iphone connects to my local wifi network and instead of getting my location using the gps in the phone it tries to get it by figuring out where my wifi network is connected to- if i turn my wifi off it keeps an accurate location point-

as soon as my phone is connected to my wifi network it starts telling me my location is several km/miles from my actual point.

i would like my app NOT to use the wifi network to try get my location-

is there a way i can- a. tell if a location point has been derived from the GPS so i can ignore locations derived from the wifi network. b. stop location services jumping over to wifi for location

like image 222
dave Avatar asked Jun 23 '10 14:06

dave


People also ask

Can Apple location work without WiFi?

Answer: A: Answer: A: It works when your iPhone has Internet Access (via wifi and/or cellular network).

Can you set iPhone location manually?

Yes, you can change your location on your iPhone using VPNs or GPS changing hardware and software, or by changing your Apple ID's country or region. VPNs work when you want to change your location by changing your IP address.

How do I find an offline location on my iPhone?

Open the Find My app. Choose the Devices tab or the Items tab. Select your missing device or item, then choose Play Sound. If your device is offline, it won't play a sound until it connects to a network.

How do you enable GPS location on iPhone?

Here's how: Go to Settings > Privacy, then select Location Services. Select an app, then turn Precise Location on or off.

How do I get GPS on my iPhone or iPad?

GPS and cellular location are available on iPhone and iPad (Wi-Fi + Cellular) models. Go to Settings > Privacy > Location Services. Make sure that Location Services is on. Scroll down to find the app.

How do I Find My location on my iPhone or iPad?

iOS and iPadOS devices might use Wi-Fi and Bluetooth to determine your location. GPS and cellular location are available on iPhone and iPad (Wi-Fi + Cellular) models. Go to Settings > Privacy > Location Services. Make sure that Location Services is on. Scroll down to find the app. Never: Prevents access to Location Services information.

How to turn off location services on iPhone?

1 Go to Settings > Privacy > Location Services. 2 Make sure that Location Services is on. 3 Scroll down to find the app. 4 Tap the app and select an option: Never: Prevents access to Location Services information. ...

How to find GPS coordinates on iPhone using compass app?

Part 4: Find the GPS coordinates on the iPhone using a compass app 1 Step 1: Install the Compass app and enable the GPS services in your iPhone by tapping ' Setting – Privacy – Location... 2 Step 2: Trigger the Compass app and view the DMS format location details at the bottom of the screen. The latitudes and... More ...


3 Answers

Well I did some playing around

Found some apple documentation that says that [location verticalAccuracy] REQUIRES a device with gps.

So I stuck this code in (abridged) and based on the limited testing I have done, it appears to be doing what I want:

if (([location horizontalAccuracy] > 0) && ([location verticalAccuracy] > 0)){
     //report location here
}

Thanks all for your replies.

like image 182
dave Avatar answered Oct 22 '22 17:10

dave


Other than asking the user to turn off his Wifi, there's no documented way you can force the location manager to use GPS over Wifi. It might be possible with private API, but that would also get you rejected from the App Store.

like image 45
Dave DeLong Avatar answered Oct 22 '22 16:10

Dave DeLong


You can set cLLocationAccuracy.desiredAccuracy = kCLLocationAccuracyBest and see if that does it. It should try and limit to GPS use, however that isn't 100% guarenteed.

like image 38
jamone Avatar answered Oct 22 '22 16:10

jamone