Skip to main content
Participant
May 14, 2011
Question

disable iOS auto-lock

  • May 14, 2011
  • 1 reply
  • 1878 views

@ http://www.adobe.com/products/air/features/

we read :

---Begin

Screen dimming (where applicable)

Disable auto-lock and screen dimming on the phone to prevent  applications from going to sleep (useful, for example, in a video  streaming application that doesn't require frequent user input).

---End


Any Idea how to disable auto-lock on iOS with air SDK 2.6?

Jrejory

This topic has been closed for replies.

1 reply

Colin Holgate
Inspiring
May 15, 2011

You can test if you're on a mobile device, and set up listeners for when the app is activated:

if (Capabilities.cpuArchitecture == "ARM") {

    NativeApplication.nativeApplication.addEventListener(Event.ACTIVATE, handleActivate, false, 0, true);

}

Then on the activate one you could make the system stay awake:

private function handleActivate(event:Event):void {

    NativeApplication.nativeApplication.systemIdleMode = SystemIdleMode.KEEP_AWAKE;

}