iosiphoneobjective-cwakelock

Is there any type of partial wake lock mechanism in ios?


In android if you hold a partial wake lock, the CPU will continue to run, regardless of any display timeouts or the state of the screen and even after the user presses the power button. In all other wake locks, the CPU will run, but the user can still put the device to sleep using the power button. Is there any such mechanism in iOS like this? For CPU will continue to run and detecting the gestures and Sensors while device is in lock screen.


Solution

  • No. This is deliberately not available and hidden by Apple to conserve battery life. The only background modes to allow this, where your app is basically always executing in the background and the device does not go to sleep (but screen can be off), are VOIP and location services. To prevent abuse of these background modes, Apple reviewers are much harder on apps that specify these modes in their plist file, to make sure the apps really require these modes.

    If you intend to make an enterprise app, which will not go to the app store, you can of course use these modes, as well as private API, to achieve what you wish.