Goal C: Do not block iPhone while the application is running

I tried to figure out how to disable iphone lock while my application was running, but I was not successful. Do you know if this is possible? My application reads values ​​from some equipment in real time, and it is really annoying when the display is constantly locked. I'm not talking about running the application in the background ... Thanks guys!

+4
source share
2 answers

Disable idleTimer in UIApplication:

[UIApplication sharedApplication].idleTimerDisabled = YES; 
+12
source

You cannot disable the lock, the user can always lock the phone. However, you can turn off the timer (auto-lock) using:

 [[UIApplication sharedApplication] setIdleTimerDisabled:YES]; 
+10
source

Source: https://habr.com/ru/post/1500322/


All Articles