Oscar Del Ben
Oscar Del Ben

Reputation: 4515

How to prevent Ipod Touch Application from going to sleep

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?

Upvotes: 6

Views: 1990

Answers (2)

RickiG
RickiG

Reputation: 11390

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:)

Upvotes: -1

kharrison
kharrison

Reputation: 3432

You can disable the sleep mode:

[[UIApplication sharedApplication] setIdleTimerDisabled:YES];

Upvotes: 18

Related Questions