tags:

views:

54

answers:

3

I have a clock program that needs to stay alive all night. I use the idletimer disabled function, but getting a text, missed call, or other notification overrides the idletimer setting back to enabled and allows the phone to sleep. I am thinking that I either need to disable the popups somehow while my app is running, or do something else to keep the phone awake (and running my app) through the popups.

Ideas? Developing with Iphone 3GS and 3.1.2

A: 

How about a timer that periodically disables the idletimer?

Dave DeLong
A: 

You can't do this, at least not with public APIs for App Store inclusion. An incoming phone call will terminate you app and you cannot prevent this.

If you aren't worried about App Store rules, then write a daemon and run your app as a background task.

marcc
A: 

Although a good idea, the timer does not work. As long as the text message popup is not dismissed manually the phone will go to sleep no matter what idleTimerDisabled state is. Does this make sense, and is there a way to prevent sleep even when a popup is on the screen.

Rick