iOS:我可以手动将 wifi 网络与地理位置关联吗?

发布于 2024-11-15 02:41:01 字数 312 浏览 4 评论 0原文

是否有可能让手机“知道”特定的wifi网络位于特定的地理位置?

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

另一个类似的问题: 有没有什么方法可以开始以约 100m 的精度监控一个区域,但告诉 CLLocationManager 使用 wifi 网络和蜂窝天线?因为无论如何我都不想打开 GPS...

谢谢!

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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

苏别ゝ 2024-11-22 02:41:01

iPhone 定位很糟糕,你无能为力。

如果您对设备进行越狱,则可以使用 Apple80211 私有框架来查找可用的 Wi-Fi 网络及其信号强度。但这也意味着您的应用程序将被拒绝。

如果用户手动连接到 Wi-Fi 您可以查看该网络上设备的 MAC 地址,并使用它来猜测您的位置。由于 Wi-Fi 的范围为 50 米,这就是您获得的精度。

所有定位系统对于 App Store 开发人员来说都是透明的,这意味着应用程序无法禁用 GPS、列出 Wi-Fi 或读取信号强度。您最多可以猜测您是否通过 GPS 或 Wi-Fi 定位并查看高度参数。

用例:您在购物中心,想知道 X 商店在哪里。可能没有 GPS 信号,如果您安装了 GPS 中继器,您将获得该中继器天线的位置,而不是您的位置。即使你安装了十几个Wi-Fi接入点你也不能要求用户手动连接,因为这样很麻烦,而且即使他手动连接也能得到50-100米的精度,那么这里连接就有安全风险在那里。基本上你完蛋了。

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.

╄→承喏 2024-11-22 02:41:01

我完全同意Jano的观点:苹果逻辑比其他解决方案更有意义。
无论如何,您可以轻松获取您的 WIFI 网络 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];

}

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];

}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文