问题
I am developing an in-house iOS application (NOT FOR APPLE STORE, so I am happy to go for private API) and I would like to be able to toggle the wifi on or off programmatically. The reason for why I want to do this is that with some WiFi routers whenever the internet connection is interrupted it happens that iPad is not able to restore the WiFi - toggling the WiFi on/off solves the problem however.
After searching around for a day on SO and Google I could not find any recent posts. Is it possible on iOS 6, without jailbreaking the device, to toggle the WiFi on/off with private APIs. Does anybody have source code he could share?
回答1:
I think it make sense to look at SystemConfiguration.framework.
It has set of API to work with different connection interfaces, which are defined here:
However, to be clear, it's just a guess. I am not sure whether these API's will allow to turn wifi on/off.
来源:https://stackoverflow.com/questions/14896622/ios6-toggle-wifi-on-non-jailbroken-device