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).
1. Stop iPhone Screen From Turning Off Automatically. All that is required to Prevent iPhone Screen from automatically switching OFF is to go to Settings > Display & Brightness > Auto-Lock > on the next screen, select the Never option.
All you need to do is click on the settings menu from the notification panel or the app drawer and go to the settings icon. Now click on the Display icon. Click on Screen Timeout and click on the Never option. After Clicking on Screen timeout your phone screen will stop turning off.
In AppDelegate add:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions...
//Add this to your method
[UIApplication sharedApplication].idleTimerDisabled = YES;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With