Limit application capabilities in IOS to only work with Cell/WiFi data.

别等时光非礼了梦想. 提交于 2019-12-05 20:12:37

Based on the documentation, setting this flag only makes sure that the device attempts to open a Wi-Fi connection. I'm not sure that it will guarantee that your networking will only occur on the Wi-Fi.

There's a class out there by apple called Reachability. https://developer.apple.com/Library/ios/samplecode/Reachability/Introduction/Intro.html

There's also a reachability class in AFNetworking 2 https://github.com/AFNetworking/AFNetworking

I would set your UIRequiresPersistentWiFi flag to YES and then check the reachability class that there is a wi-fi connection available. If not, show an error.

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