abhinav
abhinav

Reputation: 221

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

I am building an app using iPhone SDK 4. Is there a way to programmatically turn on the Wifi on an iPhone/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.

Upvotes: 0

Views: 991

Answers (1)

TechZen
TechZen

Reputation: 64428

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.

Upvotes: 2

Related Questions