Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programmatically lock and unlock iPhone screen

Tags:

iphone

How do I programmatically lock and unlock the main screen (i.e. the device itself) of an iPhone?

like image 383
Arun Thakkar Avatar asked May 07 '09 04:05

Arun Thakkar


People also ask

How do I get my iPhone to unlock automatically?

From the Keychain, select the Home the lock is associated with. Navigate to Settings and select the Lock from the House Settings. Go to Auto-Unlock. Toggle Enabled Auto-Unlock to ON.

How do I lock my iPhone screen instantly?

To lock the iPhone immediately, press the Sleep/Wake button. To unlock it, press the Sleep/Wake button again. Or, press the Home button on the front of the screen.

Can I unlock my iPhone with a pattern lock?

A pattern lock is a screen-lock that you can unlock by drawing a predetermined pattern, like a shape or an arrow, on the screen. You can put a pattern lock on an iPhone using a tweaked app extracted from a package manager. The tweaked apps are third-party apps that you can download, which are not available on iPhone.


1 Answers

It's not possible. However, you can "prevent" your phone from locking when your app is running. [UIApplication sharedApplication].idleTimerDisabled = YES should do it.

like image 187
Mugunth Avatar answered Nov 15 '22 03:11

Mugunth