How do I use NativeApplication class to align to user device settings?
My application was rejected by Barnes & Noble for the following reason:
Your application overrides the internal suspension mechanism. Our devises are set to suspend after 2 minutes of inactivity yet had not suspended after 5+ minutes. Please make sure your
application allows user's devises to suspend according to their settings and resubmit.
//*****************************
I am using the following code. The code in the red in relavant to the question:
NativeApplication.nativeApplication.systemIdleMode = SystemIdleMode.KEEP_AWAKE;
stage.addEventListener(Event.DEACTIVATE, onLeave);
//gets current frame and current scene when the user leaving the app
function onLeave(event:Event):void
{
stage.addEventListener(Event.ACTIVATE, onComeBack);
so.data.currentFrame = this.currentFrame;
so.data.currentSceneName = this.currentScene.name;
SoundMixer.stopAll();
stop();
NativeApplication.nativeApplication.systemIdleMode = SystemIdleMode.NORMAL;
}
//Adds pop-up screen and asks would they like to resume or restart.
function onComeBack(event:Event):void
{
NativeApplication.nativeApplication.systemIdleMode = SystemIdleMode.KEEP_AWAKE;
if (!modalW)
{
modalW = new ModalW();
addChild(modalW);
modalW.x = -97;
modalW.y = -78;
modalW.resumego.addEventListener(MouseEvent.CLICK,resumeF);
modalW.restartgo.addEventListener(MouseEvent.CLICK,restartF);
}
else
{
addChild(modalW);
}
}
How do I use the NativeApplication class to allow the user's devices to suspend according to their settings?
