iOS Get list of all WiFi networks

早过忘川 提交于 2019-11-29 07:33:26

问题


This is not a duplicate of the dozens of similar questions (too many to list) because I have evidence that it is possible to publish an app that displays a list of wifi networks.

So, it has been widely accepted and understood that you cannot get a list of all wifi networks without using a private api. The use of a private api will cause an app to be rejected from app store review.

However, Google did it recently in their Google Home app that was released on 10/26/2016, so it must be possible now. How?!?

Note- their App Store listing says the app supports iOS 8.0 or later. I need to further test if this functionality only exists on the iOS 10 version of the app, or if it in fact also exists on iOS 8 and 9.
(I grayed out my wifi name and mac address in the image)

I'm using Objective-C, so if you submit a solution in Swift, please submit an ObjC one too!


回答1:


This might be possible with NetworkExtension (available since iOS 8). But you need the com.apple.developer.networking.HotspotHelper-entitlement in you app to use these APIs. To get these entitlement, you have to contact Apple and describe, why you need it.

I haven't found any code examples, but maybe the documentation of NetworkExtension helps you.



来源:https://stackoverflow.com/questions/40681984/ios-get-list-of-all-wifi-networks

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