Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Keeping App in forground (iOS)

I have an application which performs a long running network operation. Now long running means approx 2 hour or more. Since this app downloads data from server and updates the ui as well it is required to keep is protected from iOS lock (screen gets locked and app is sent to background).

I have seen apps which can protect themselfs from being sent into background, for example angrybirds, you open any level and keep it idle, screen will not lock.

Do anyone having any idea how to do that?

like image 522
kumar Avatar asked Nov 17 '11 01:11

kumar


1 Answers

[UIApplication sharedApplication].idleTimerDisabled = YES;

will disable the automatic screen lock.

like image 193
esqew Avatar answered Oct 04 '22 03:10

esqew