Search code examples
iphoneioswificore-locationcllocationmanager

iOS: Can I manually associate wifi network with geographic location?


Is it possible to make the phone to "know" that a specific wifi network is at specific geographic location?

if (answer == YES)
{  
    than how?
}
else
{
    can the phone figure this out by himself?  
}

Another similar question: is there any way to start monitor a region with accuracy of ~100m but telling the CLLocationManager to use only by wifi networks and cellular antenas? Because I don't want to power up the GPS no matter what...

Thanks!


Solution

  • iPhone positioning sucks and there is nothing you can do.

    If you jailbreak your device you can use the Apple80211 private framework to look up the available Wi-Fi networks and their signal strength. But that also means your app will get rejected.

    If the user manually connects to a Wi-Fi you can see the MAC addresses of the devices on that network and use that to guess your position. Since Wi-Fi has a range of 50 meters, that's the accuracy you get.

    All the positioning system is transparent for an App Store developer, meaning an application can't disable the GPS, list Wi-Fis, or read the signal strength. The most you can do is guess if you are positioning through GPS or Wi-Fi looking at the altitude parameter.

    Use case: You are in a mall and you want to know where shop X is. Probably there is no GPS signal, and if you install a GPS repeater you get the position of the antenna of that repeater, not your position. Even if you install a dozen Wi-Fi access points you can't ask the user to manually connect because it's a hassle, and even if he did he would get 50-100 meters accuracy, and then there is the security risk of connecting here and there. Basically you are screwed.