9

I recently started developing iPhone apps in Objective-C and put together a small universal video player which allows me to view TV shows, movies and the like on my iPhone. Everything is working flawlessly except one minor thing.

The display always turns off after a minute or two and turns black if I don't tap the screen within that time span.

I'm wondering whether it's possible to programmatically keep the display on while my app is open. I've already tried setting idleTimerDisabled to true, without success, though.

My device is jailbroken if it makes a difference and I'm also open for solutions that would work on jailbroken devices only (if there are any solutions for this scenario).

Juan Boero
  • 6,281
  • 1
  • 44
  • 62
beta
  • 2,583
  • 15
  • 34
  • 46

1 Answers1

15

In AppDelegate add:

  - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions...

//Add this to your method
[UIApplication sharedApplication].idleTimerDisabled = YES;
William Falcon
  • 9,813
  • 14
  • 67
  • 110
  • I use this in a few live apps and it works... – William Falcon Mar 28 '13 at 20:52
  • Hint: this is the same answer I provided. –  Mar 28 '13 at 20:59
  • 2
    Not as clear... but cool downvote – William Falcon Mar 28 '13 at 21:00
  • 4
    I don't really understand why anyone would downvote in this thread since it was a genuine question & two genuine answers. And the only reason I chose this one as answer was that it actually was more helpful than the "look it up in the docs yourself" answer. Thanks though for both contributions. – beta Mar 28 '13 at 21:07