How do I programmatically lock and unlock the main screen (i.e. the device itself) of an iPhone?
It can be done by caling GSEventLockDevice (); from your app. This function can be found in GraphicsServices.framework.