Windows Phone 8 (WP8) - Suspend not working

Bugs will be moved here once resolved.

Post » Wed Jan 09, 2013 5:47 am

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:
https://dl.dropbox.com/s/zvrorjglsx2ns80/HypnosisWheel_v1.0.0.3.capx?dl=1

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
B
6
Posts: 9
Reputation: 645

Post » Wed Jan 09, 2013 12:58 pm

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.
Moderator
B
72
S
13
G
11
Posts: 900
Reputation: 11,783

Post » Fri Jan 11, 2013 3:57 am

Sweet! Looking forward to it.
B
6
Posts: 9
Reputation: 645

Post » Fri Jan 11, 2013 1:10 pm

@Rob Kachmar - have you tried r115? I made some changes to how WP8 suspend works, although it might not be perfect still...
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,468

Post » Fri Jan 11, 2013 9:13 pm

If you guys need any C# or Silverlight help, let me know. I've been making WP apps since launch.
B
30
S
10
G
7
Posts: 416
Reputation: 7,239

Post » Fri Jan 11, 2013 10:56 pm

@firebelly have you been able to get a decent debugger working on WP? I followed this tutorial http://matthiasshapiro.com/2012/12/03/debugging-an-html5-windows-phone-app/ but that only gives me things I specifically log. Been looking for a solution that's just like the VS console for W8.
Moderator
B
72
S
13
G
11
Posts: 900
Reputation: 11,783

Post » Sat Jan 12, 2013 3:21 am

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.

firebelly,
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...

Requirements
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.
B
6
Posts: 9
Reputation: 645

Post » Sun Jan 13, 2013 10:25 am

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');");

to

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

and

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

to

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.
Moderator
B
72
S
13
G
11
Posts: 900
Reputation: 11,783

Post » Sun Jan 13, 2013 10:27 am

Also @Rob Kachmar if that doesn't work, pm me a link to the Windows Phone build and I'll take a look.
Moderator
B
72
S
13
G
11
Posts: 900
Reputation: 11,783

Post » Sun Jan 13, 2013 8:35 pm

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.

https://www.dropbox.com/s/mvp760jnwy2qgmp/HypnosisWheelWin8Phone.zip

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.

B
6
Posts: 9
Reputation: 645

Next

Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 3 guests