开发者

Is there a way to turn on wifi on iphone through your app's code?

开发者 https://www.devze.com 2023-01-08 07:02 出处:网络
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 t

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消