Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 02-16-2009, 03:34 PM   #1 (permalink)
New Member
 
Join Date: Feb 2009
Posts: 9
soupjr is on a distinguished road
Default Keep WiFi Active?

Hello,

I have written an app that basically removes the Safari navigation bars by using a UIWebView and a settings bundle to set url. A pretty simple app... however, even with JavaScript sending AJAX calls and AutoLock turned off, the iPod Touches still turn off the WiFi radio after some time (can't tell exactly how long). Is there any way that I can keep the radio alive programmatically? I have found some sample code from Apple that shows how to detect availability but no discussion on activating the radio if it shuts off.

I do not want to do any jailbreaking in order to accomplish this. I have AutoLock set to 'Never' because ideally I'd like to keep the display on at all times. (By the way, the organization I work for owns all the devices this app will be on which is why the AutoLock will always be set to Never).

If anyone can help, I would very much appreciate it.

Thanks!
soupjr is offline   Reply With Quote
Old 02-16-2009, 05:45 PM   #2 (permalink)
Registered Member
 
Join Date: Aug 2008
Posts: 80
ecume is on a distinguished road
Default voila

add the following to your info.plist

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


Quote:
Originally Posted by soupjr View Post
Hello,

I have written an app that basically removes the Safari navigation bars by using a UIWebView and a settings bundle to set url. A pretty simple app... however, even with JavaScript sending AJAX calls and AutoLock turned off, the iPod Touches still turn off the WiFi radio after some time (can't tell exactly how long). Is there any way that I can keep the radio alive programmatically? I have found some sample code from Apple that shows how to detect availability but no discussion on activating the radio if it shuts off.

I do not want to do any jailbreaking in order to accomplish this. I have AutoLock set to 'Never' because ideally I'd like to keep the display on at all times. (By the way, the organization I work for owns all the devices this app will be on which is why the AutoLock will always be set to Never).

If anyone can help, I would very much appreciate it.

Thanks!
ecume is offline   Reply With Quote
Old 02-17-2009, 07:45 AM   #3 (permalink)
New Member
 
Join Date: Feb 2009
Posts: 9
soupjr is on a distinguished road
Default Thanks and quick follow-up

Thanks ecume! As far as I can tell my 2 test devices are maintaining their WiFi connection even after 10+ minutes without a touch event.

One quick follow up question for you if you have a free minute. I found this link to see all the possible info.plist field/value pairs, but is there a more official list? The UIRequiresPersistentWiFi was not mentioned in the SDK docs as far as I can tell.

Thanks again!

Quote:
Originally Posted by ecume View Post
add the following to your info.plist

<key>UIRequiresPersistentWiFi</key>
<true/>
soupjr is offline   Reply With Quote
Old 02-17-2009, 07:52 AM   #4 (permalink)
iOS / MacOS Developer
 
bharath2020's Avatar
 
Join Date: Oct 2008
Location: Bengaluru
Posts: 151
bharath2020 is on a distinguished road
Default

It is officially mentioned in iPhone OS Programming guide.. Search for UIPersistentWifi key in the pdf.. Wifi connection is switched off after 30 min from the time when the application is launched to preserve battery..
bharath2020 is offline   Reply With Quote
Old 02-17-2009, 08:13 AM   #5 (permalink)
New Member
 
Join Date: Feb 2009
Posts: 9
soupjr is on a distinguished road
Default Found It

Found it bharath2020 - Thanks for reference!

Quote:
Originally Posted by bharath2020 View Post
It is officially mentioned in iPhone OS Programming guide.. Search for UIPersistentWifi key in the pdf.. Wifi connection is switched off after 30 min from the time when the application is launched to preserve battery..
soupjr is offline   Reply With Quote
Old 06-25-2009, 02:13 AM   #6 (permalink)
iPhone Developer
 
Narender Mudgal's Avatar
 
Join Date: Dec 2008
Location: India
Age: 28
Posts: 156
Narender Mudgal is on a distinguished road
Send a message via MSN to Narender Mudgal Send a message via Skype™ to Narender Mudgal
Default can we check sound on/off programatically

Quote:
Originally Posted by soupjr View Post
Hello,

I have found some sample code from Apple that shows how to detect availability but no discussion on activating the radio if it shuts off.

Thanks!
hi soupjr,
can you please give me the link for that apple code,
I want to check wheather we can programatically check for sound(on/off) or not.
Narender Mudgal is offline   Reply With Quote
Old 06-25-2009, 06:18 AM   #7 (permalink)
New Member
 
Join Date: Feb 2009
Posts: 9
soupjr is on a distinguished road
Default Reachability

Quote:
Originally Posted by Narender Mudgal View Post
hi soupjr,
can you please give me the link for that apple code,
I want to check wheather we can programatically check for sound(on/off) or not.
Hey Naren,

Here is the Apple sample code.

https://developer.apple.com/iphone/l.../Reachability/

Bear in mind this code is specifically geared to help you detect for WiFi or Edge/3G. I doubt it can detect whether someone has their sound turned on or off.
soupjr is offline   Reply With Quote
Reply

Bookmarks

Tags
keep alive, radio, uiwebview, wifi

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 329
4 members and 325 guests
guusleijsten, HowEver, LEARN2MAKE, mottdog
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,649
Threads: 94,113
Posts: 402,880
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Anwerbl
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 08:42 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0