Skip to main content
Mr. Baker the Shoe Maker
Inspiring
July 16, 2012
Question

How do I use NativeApplication class to align to user device settings?

  • July 16, 2012
  • 2 replies
  • 769 views

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?

This topic has been closed for replies.

2 replies

Colin Holgate
Inspiring
July 16, 2012

What you are doing is probably correct, if you want the device to suspend when not in your app. But, I think they may be complaining about it not suspending while inside your app. You should either let it suspend, or tell B&H the reason why you need it to be forced to stay awake.

If there are some moments in the app where it would fall asleep while the user is using the app, like when watching a video for example, you could still set the awake value back to normal when you're in other parts of your app.

Mr. Baker the Shoe Maker
Inspiring
July 20, 2012

Thanks.