PDA

View Full Version : Turning Wi-Fi ON/OFF




CarlosH
Aug 29, 2008, 09:59 AM
Hi all. Is there a way to turn on wi-fi from my app? So if for example a user has his wi-fi off, but my app needs it, can I turn it on? Or is not available on the sdk?


Thanks in advance.



JML42691
Aug 29, 2008, 10:01 AM
I do not believe that you can, I am almost certain that it has to be the user that goes into the Settings app and turns the wifi on, I do not believe that you can do it automatically.

CarlosH
Aug 29, 2008, 10:20 AM
I do not believe that you can, I am almost certain that it has to be the user that goes into the Settings app and turns the wifi on, I do not believe that you can do it automatically.

That's what I thought, since didn't found anything in the sdk, but was hoping I overlooked something. Thanks.

kainjow
Aug 29, 2008, 10:29 AM
You can't, but you can add this key to your Info.plist:

<key>UIRequiresPersistentWiFi</key>
<true/>

Documented here:
http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/ApplicationEnvironment/chapter_6_section_4.html

ChrisBrightwell
Aug 30, 2008, 10:59 PM
^ Can you point to a document asserting that you can't?

I've been looking, but can't find it.

robbieduncan
Aug 31, 2008, 02:53 AM
^ Can you point to a document asserting that you can't?

I've been looking, but can't find it.

In general the documentation doesn't say what you can't do, only what you can. If it doesn't say you can do X then most likely you can't

Cromulent
Aug 31, 2008, 06:03 AM
Plus it goes against Apples software philosophy. Remember that the user should always be in control. If they turn Wifi on or off then chances are that that is the correct setting. Developers should not try and change user defined settings.