Amazon devices restart on exit

Amazon has failed our most recent app on Kindle Fire tablets because…

"Bug Description:State Loss / App restarts from different state

 

Steps to Reproduce:

 

1.Install and launch the app. 

2.Tap on play button. 

3.Play game a while. 

4.Tap on device back button. 

5.Relaunch the app,app restarts from beginning."

 

I verified that the app does restart when you press the back button. First I checked to verify that UIApplicationExitsOnSuspend was not set to true in build.settings. It was commented out.
Still, the app restarts when I press the back button.

Next I found this thread:
http://forums.coronalabs.com/topic/37653-uiapplicationexitsonsuspend-not-working-on-android/

The original question states that the dev was having the same issue as me, but then the solution proposed is for MAKING THE APP EXIT when it is suspended. This is not what I want to do. I need to the app to resume when it is suspended, then started again.

Any ideas? 

UPDATE: The app will resume when pressing “home”, then restarting. Only the “back” button causes the app to exit. We are examining the back button code.

 

Amazon apps are getting rejected on our end too - any ideas on how to fix or update this??

We’re having an issue with this currently as well, and it’s something that didn’t exist up until recently since we typically push to Amazon as well as Google/Apple on a bi-weekly basis, usually.  It’s not just the back button being pressed during any ‘normal’ part of the game… it’ll exit the app if pressed at any time, and when they resume the app it’s like it was force closed, as the app completely restarts (in example, with the case of the ad appearing, it is expected to close the ad and return to the app, but it minimizes everything, basically, and then trying to get back in the whole app doesn’t pick up where left off and starts over).

This didn’t seem to be an issue before, maybe this is a new thing they are testing for in Amazon builds?  Is there some way we can make the app suspend more ‘gracefully?’  I tried calling native.requestExit() on app suspend, and it didn’t seem to help as it was still rejected for the same reasons.  

For Google Play… in example with the ads, when an ad comes up and I press the back button the whole game doesn’t get minimized, the ad is just closed as expected in that situation, then is resumed where left off just fine.  The back button otherwise seems to still force the app to restart on being resumed afterward, however if the app is minimized other ways it will resume from where the player left off fine.

Hi @elsoqo,

This is not a bug/issue. Pressing the “Back” key on Android has always exited the app. As in, Corona will dispatch an “applicationExit” when the back key is pressed just before the Android OS destroys Corona’s Activity/Window. This is normal behavior for all native Android apps and this is how it works on all Android devices. Only the “Home” key will suspend the app, just like how it works on iOS.

When an app reviewer rejects an app for this behavior, it’s usually because they expected the back key to navigate back to the previous scene within the app (i.e. via Corona’s Composer scene heirarchy). This can be done by handling Corona’s “back” key event.

Also, for reference in this thread, the “UIApplicationExitsOnSuspend” setting is only applicable to iOS and it has no effect on Android. That’s why it is under the “iphone” plist section of the “build.settings” file.

Thanks,

Brent

I can confirm Brent’s post. Amazon approved our app once we tweaked the code so that the device back button takes the user to the previous screen instead of quitting the app.

tho recommend you don’t continue that same handling if already currently sitting on your title screen (or equivalent) where kindle users will expect the back key to (finally) actually exit.

you won’t get rejected for it, but reviewers will likely mark you down (fe “I’m subtracting a star for not exiting cleanly” seems pretty common in reviews)  your handling has to make sense everywhere - no surprises.

most gplay users (or generic android user at amazon) couldn’t care less, but kindlers love their back button.  :D

Just got an email from an Amazon rep who said this shouldn’t be an issue anymore with the back button, so it sounds like they may be eliminating that as a requirement moving forward - they are going over the guidelines with QA as I made him aware of this yesterday

Amazon apps are getting rejected on our end too - any ideas on how to fix or update this??

We’re having an issue with this currently as well, and it’s something that didn’t exist up until recently since we typically push to Amazon as well as Google/Apple on a bi-weekly basis, usually.  It’s not just the back button being pressed during any ‘normal’ part of the game… it’ll exit the app if pressed at any time, and when they resume the app it’s like it was force closed, as the app completely restarts (in example, with the case of the ad appearing, it is expected to close the ad and return to the app, but it minimizes everything, basically, and then trying to get back in the whole app doesn’t pick up where left off and starts over).

This didn’t seem to be an issue before, maybe this is a new thing they are testing for in Amazon builds?  Is there some way we can make the app suspend more ‘gracefully?’  I tried calling native.requestExit() on app suspend, and it didn’t seem to help as it was still rejected for the same reasons.  

For Google Play… in example with the ads, when an ad comes up and I press the back button the whole game doesn’t get minimized, the ad is just closed as expected in that situation, then is resumed where left off just fine.  The back button otherwise seems to still force the app to restart on being resumed afterward, however if the app is minimized other ways it will resume from where the player left off fine.

Hi @elsoqo,

This is not a bug/issue. Pressing the “Back” key on Android has always exited the app. As in, Corona will dispatch an “applicationExit” when the back key is pressed just before the Android OS destroys Corona’s Activity/Window. This is normal behavior for all native Android apps and this is how it works on all Android devices. Only the “Home” key will suspend the app, just like how it works on iOS.

When an app reviewer rejects an app for this behavior, it’s usually because they expected the back key to navigate back to the previous scene within the app (i.e. via Corona’s Composer scene heirarchy). This can be done by handling Corona’s “back” key event.

Also, for reference in this thread, the “UIApplicationExitsOnSuspend” setting is only applicable to iOS and it has no effect on Android. That’s why it is under the “iphone” plist section of the “build.settings” file.

Thanks,

Brent

I can confirm Brent’s post. Amazon approved our app once we tweaked the code so that the device back button takes the user to the previous screen instead of quitting the app.

tho recommend you don’t continue that same handling if already currently sitting on your title screen (or equivalent) where kindle users will expect the back key to (finally) actually exit.

you won’t get rejected for it, but reviewers will likely mark you down (fe “I’m subtracting a star for not exiting cleanly” seems pretty common in reviews)  your handling has to make sense everywhere - no surprises.

most gplay users (or generic android user at amazon) couldn’t care less, but kindlers love their back button.  :D

Just got an email from an Amazon rep who said this shouldn’t be an issue anymore with the back button, so it sounds like they may be eliminating that as a requirement moving forward - they are going over the guidelines with QA as I made him aware of this yesterday