What is the iOS API for scanning available wi-fi networks

柔情痞子 提交于 2019-11-30 16:04:48

问题


That's the question, but here's the long version: I'm working on a project that needs to mimic the connection workflow of the Belkin Wemo. The Wemo is a physical switch that can be controlled from an iOS app.

This is how the setup works:

  1. The Wemo acts as a wifi router, it broadcasts an SSID, and you choose it from the list of available networks in your iPhone settings.
  2. You then choose your home wi-fi network from within the wemo app, given a list of available networks. and enter your network password. Presumably so the Wemo device can connect to your wi-fi router.
  3. The Wemo app then announces it is connecting, and then that it is setting up remote access.

Which brings me to: How does the Wemo app check for available networks -- aka, Is there an iOS API for scanning available networks, displaying them and working with them?


回答1:


There is no public API in iOS currently that can do this (used to be available pre iOS 5). You can check out a third party library like Stumbler which should help you achieve the viewing of networks: http://code.google.com/p/iphone-wireless/wiki/Stumbler




回答2:


As question is very old and Apple has come with new advances in iOS.

It is now possible to scan the wi-fi using NEHotspotHelper (Apple Doc). But you still need permission from Apple to use this extension as NEHotspotHelper is special API with some guidelines (link).

Apple TQ & A



来源:https://stackoverflow.com/questions/16926657/what-is-the-ios-api-for-scanning-available-wi-fi-networks

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!