I am building an app using iPhone SDK 4. Is there a way to programmatically turn on the Wifi on an i开发者_如何转开发Phone/iPodTouch (iOS 4 specifically) if it is switched off ? I want to be able to turn on Wifi (if its turned off) after alerting the user and taking his/her decision into account.
Thanks,
Abhinav.No, you can't override the user's settings for the device itself.
You can set the app to require Wifi by putting the UIRequiresPersistentWiFi
key into the apps Info.plist file. This will evoke a system dialog asking the user to activate WiFi if it is not available.
精彩评论