IPhone: Can I programmatically turn off the automatic shutdown of the display?

Recently I started developing iPhone applications in Objective-C and put together a small universal video player that allows me to watch TV shows, movies, etc. on my iPhone. Everything works flawlessly, except for one minor thing.

The display always turns off after a minute or two and turns black if I do not press the screen during this period of time.

I am wondering if it is possible to programmatically keep the display on while my application is open. I have already tried setting idleTimerDisabled to true, but to no avail.

My device has jailbroken if it matters, and I am also open to solutions that will only work on jailbroken devices (if there are any solutions for this scenario).

+6
source share
1 answer

In AppDelegate add:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions... //Add this to your method [UIApplication sharedApplication].idleTimerDisabled = YES; 
+13
source

All Articles