Wifi 定位原理及 iOS Wifi 列表获取
iOS 上获取 Wifi 列表其实有很大限制,在 iOS 9 以前是不能获取Wifi列表的,只能获取当前连接的 Wifi 信息,也就表示只有连接了 Wifi 才能定位。
Apple 在 iOS 9 以后,提供了获取Wifi列表的API,但是获取Wifi列表是有门槛的,主要步骤有:
- 1、向 Apple 申请开发 Network Extension 权限
- 2、申请包含 Network Extension 的描述文件
- 3、配置 Info.plist
- 4、配置 entitlements
- 5、iOS 获取 Wifi 列表代码实现
- 6、获取Wifi列表回调
1、向 Apple 申请开发 Network Extension 权限
首先要先写封邮件给 networkextension@apple.com ,问苹果要开发 Network Extension 的权限。
苹果收到邮件后会自动回复邮件,在 https://developer.apple.com/contact/network-extension/ 里面填写申请表格,内容包括:
Organization:
Company / Product URL:
What's your product's target market?
What's your company's primary function?
Describe your application and how it will use the Network Extension framework.
What type of entitlement are you requesting?
。。。
申请后大概两周左右能收到 Aplle的 确认信,如:
Hi,
Thanks for your interest in the Network Extension APIs.
We added a new templa