ankit_rck
ankit_rck

Reputation: 1806

Screen always on when my app runs on iPad

I have developed a iPad app and i want that the screen should never sleep or lock. I want the screen to be on when the app runs.

In android there is a screen and wake lock which handles the same, but i was unable to find the same for IOS.

I am guessing it will be some setting in Project or target. Please help.

Upvotes: 3

Views: 1411

Answers (2)

Popeye
Popeye

Reputation: 12093

You should be able to use

[[UIApplication sharedApplication] setIdleTimerDisabled:YES];

You should be able to put this in didFinishLaunchingWithOptions: method in your AppDelegate.

Upvotes: 7

Deepak Bharati
Deepak Bharati

Reputation: 280

Use the following in your viewDidLoad

//don't lock
    [[UIApplication sharedApplication] setIdleTimerDisabled:YES];

Upvotes: 4

Related Questions