Windows Phone 8 (WP8) - Suspend not working

0 favourites
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • I recently created a few apps with Construct 2 and successfully uploaded them to the Windows 8 Store. However, when I tried to export the same apps to the Windows Phone 8 Store, they all failed certification because the apps did not resume where they left off when the user switches away to do something else on the phone.

    In Windows 8, the same apps properly go into a suspended mode when you navigate away from them. They pick up exactly where they left off when you go back to them. In Windows Phone 8, the apps restart from the beginning.

    Here is a very simple app to show this behavior:

    Reproduce the behavior:

    1) Open the .capx file and export it to Windows Phone 8

    2) Open the .sln file in the export directory

    3) Run the project

    4) Double tap a few times on the circle to increase the speed

    5) Now tap the back button or windows button

    6) Then go back to the app and it will be reset back to its original speed

  • This is a limitation of the exporter. You're going to fail lots of other certification requirements too, like properly handling audio when the user is playing music, back button functionality etc.

    I'm working on a plugin at the moment that adds the necessary functionality. ETA is probably about a week at the moment as also working on Surface optimisations.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Sweet! Looking forward to it.

  • rob Kachmar - have you tried r115? I made some changes to how WP8 suspend works, although it might not be perfect still...

  • If you guys need any C# or Silverlight help, let me know. I've been making WP apps since launch.

  • firebelly have you been able to get a decent debugger working on WP? I followed this tutorial but that only gives me things I specifically log. Been looking for a solution that's just like the VS console for W8.

  • Ashley,

    I tried exporting again with the r115 release, but I am still experiencing the same reset behavior. I updated the .capx link above with the file I opened in the new r115 release.


    How are you maintaining state in your app after the user clicks the back or windows button on the phone, and then comes back to your app?

    BTW, this is from the app failure report I received...


    A Windows Phone app is deactivated when the user presses the Start button or if the device timeout causes the lock screen to engage. A Windows Phone app is also deactivated with it invokes a Launcher or Chooser API.

    A Windows Phone OS 7.0 app is tombstoned (terminated) when it is deactivated. A Windows Phone OS 7.1 or higher app becomes Dormant when it is deactivated but can be terminated by the system when resource use policy causes it to tombstone.

    When activated after termination, the app must meet the requirements in Section 5.2.1 - Launch time.

    For more information and best practices, see App activation and deactivation for Windows Phone.

  • Just to come back to this:

    I haven't exported using the latest release, but in r114 changing the following fixed the issue for me:

    Browser.InvokeScript("if (window.C2WP8Notify) C2WP8Notify('activated');");


    Browser.InvokeScript("eval", "if (window.C2WP8Notify) C2WP8Notify('activated');");


    Browser.InvokeScript("if (window.C2WP8Notify) C2WP8Notify('deactivated');");


    Browser.InvokeScript("eval", "if (window.C2WP8Notify) C2WP8Notify('deactivated');");

    When we released a game on Windows Phone 7, you had to handle tombstoning, which was essentially saving the game state to isolated storage and loading it up again on resume. Looks like this is all done automagically on Windows Phone 8, yay.

  • Also rob Kachmar if that doesn't work, pm me a link to the Windows Phone build and I'll take a look.

  • Thanks for the reply. I tried out your suggestion, but no luck. Below is a link to the exported WP8 files with your suggested change.

    I think the problem is that the OnAppActivated() and OnAppDeactivated() methods are never even being called. I even added some simple MessageBox calls inside of them to troubleshoot when they are called, but they never fire.

  • I realized the previous project links I provided may not be the easiest type of project to identify the lack of suspend functionality in WP8.

    Here are some new links with a simple project that increments a text box score on any click or touch. When you navigate away from the app in WP8 and come back to it, the score will revert back to zero and not maintain its previous value.

    NOTE for "thehen": The link has your suggested fix, but unfortunately it does not work.

    The Construct 2 project:

    The Windows 8 App export where state is maintained between app switching.

    The Windows Phone 8 App export where state is NOT maintained between app switching.

  • I'm not sure of the problem - it works fine for me here.

    With the project you uploaded comment out the MessageBox lines.

    In index.html, under 'cr_setSuspended(false);' add 'alert("Activated!")'

    You'll then see the alert message when the game is resumed. Spinning speed is the same as when exited.

  • Add me on Skype if you still can't get this to work and we'll go through it - hoffmania1

  • First off, thanks for spending time to help me with my little problem.

    Unfortunately I can't seem to get it working. I tried your suggestions without any luck. Here's a quick video of me exporting a simple project and making the suggested tweaks.

    Here is the exported solution from the video:

    Here is the Construct 2 project from the video:

    BTW, I tried out your Mortar Melon game, very cool! It's inspiring to see what is possible with Construct 2.

  • Hi Rob,

    The version you uploaded works great.

    What the video shows is that after quitting the app, you're relaunching it from icon, which by default starts the application from the beginning. If you quit the app and tap the back button, you'll see the activation/deactivation working as expected.

    The functionality that you've described and want to achieve is called 'Fast Resume'. You can find more info here: To enable fast resume, open up WMAppManifest.xml and add ActivationPolicy="Resume" to the DefaultTask element. E.g.

    <DefaultTask Name ="_default" NavigationPage="MainPage.xaml" ActivationPolicy="Resume"/>

    It's important to note that you don't have to add this to pass certification.

    Thanks for trying out Mortar Melon :D

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)