PDA

View Full Version : Keeping app from going to "sleep"




jsnuff1
Jul 19, 2008, 07:58 PM
The app I am currently creating requires that it always remain active in order for it to function properly. Unfortunatly the OS puts the phone to sleep after a few min of no input by the user, this causes some of the core services to stop communicating with my app untill the user wakes the iphone again.

Is there anyway to either keep the core services communicating even after the phone goes to sleep, or to keep the phone from going to sleep altogether untill my app is quit?

Thanks.



Nutter
Jul 20, 2008, 12:56 PM
I've been wondering exactly the same thing. Does anyone know the answer to this?

lyptt
Jul 21, 2008, 03:10 AM
Not on the official SDK there isn't, if this is an official app you're developing then you'll just have to make it so that if the app does go to sleep it's handled properly.

Nutter
Jul 21, 2008, 07:19 AM
I'm pretty sure that Pandora keeps playing when the device is in sleep mode.

jsnuff1
Jul 25, 2008, 11:41 PM
the AIM app somehow disables auto-lock as well....if i launch AIM and do nothing it wont go to sleep....so there is an official way to do it...just got to find out how.

Any ideas anyone?

rarunach
Jul 26, 2008, 05:40 PM
I read somewhere that the following setting will avoid auto-locking.

application.idleTimerDisabled = YES.

Unfortunately, I didn't know about this before submitting the app and I am planning to add it in an update.

iphonehere
Aug 7, 2008, 02:41 PM
The next line, is only prevent it goes into sleep mode.

application.idleTimerDisabled = YES.

So how does app keep running in the sleep mode ? Like aol radio or Pandora does.

fixie rider
Oct 10, 2008, 12:19 PM
I read somewhere that the following setting will avoid auto-locking.

application.idleTimerDisabled = YES.


Does apple reject apps that do this?

Nonnus3G
Oct 10, 2008, 12:41 PM
no they dont

most of my apps have this

if the user manually locks the device while using them (without pressing home button)
they will keep running