I am building an application for the ipod touch that needs to run for several time (like an alarm clock). I would like to prevent the ipod touch from going to sleep unless the use manually exit the application. Is this possible with the current SDK?
How to prevent Ipod Touch Application from going to sleep
Asked Answered
check this link...cocoabugs.blogspot.com/2010/10/… –
Disfeature
You can disable the sleep mode:
[[UIApplication sharedApplication] setIdleTimerDisabled:YES];
This one is right but "sometimes" , I noticed that it does not work (even with such settings, the iphone goes to idle :/) . It's not 100% reproducable, I don't know in which cases it occurs (I was on 3.0 when I noticed that), but if someone has also noticed that and if there's a known way to work around it... :/ –
Beluga
As kharrison says...
But read-up on what Apple has to say about it here: iPhone Application Programming Guide
For your use-case I think you should consider dimming the screen after a few seconds to minimize power consumption. Also if it is an alarm clock, not to keep the user awake all night:)
Apple does not allow you to dim the screen. –
Faustinafaustine
© 2022 - 2024 — McMap. All rights reserved.