4

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!

Avi Shukron
  • 6,088
  • 8
  • 50
  • 84

2 Answers2

4

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.

Jano
  • 62,815
  • 21
  • 164
  • 192
  • Well, I guess I'll go only for android on this time... At least thank you for your honest answer... :-) – Avi Shukron Jun 14 '11 at 11:06
  • Better answer here: http://stackoverflow.com/questions/15732181/ Also, there is now Cisco hardware for this, google "Cisco Mobility Services Engine". – Jano Apr 15 '13 at 15:17
0

I completely agree with Jano: apple logic has more sense than other solutions. Anyway You can easy get your WIFI network id:

-(void)LogInfo:(NSDictionary*)info forKey:(NSString*)key;
{
    NSString* temp;
    temp = [info objectForKey: key];
    NSLog(temp);
}


- (void)fetchSSIDInfo
{
    NSArray *ifs = (id)CNCopySupportedInterfaces();
    NSDictionary* info = nil;
    for (NSString *ifnam in ifs)
    {
        info = (id)CNCopyCurrentNetworkInfo((CFStringRef)ifnam);
        NSString *temp = [NSString stringWithFormat:@"%@", [info description]];
        [self AddToLog: temp];

        [self LogInfo:info forKey:@"BSSID"];
        [self LogInfo:info forKey:@"SSID"];
        [self LogInfo:info forKey:@"SSIDDATA"];
        [info release];
    }

    [ifs release];

}
ingconti
  • 10,876
  • 3
  • 61
  • 48