views:

36

answers:

1

Hi,

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.

+1  A: 

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.

TechZen
Thanks ! pretty much what I was looking for, as I also had the notion that you could not force a setting on to the user.
abhinav