In debug mode, I printed out the log and found the value of Guide.IsTrialMode always false…
It seems Guide.SimulateTrialMode does the trick…
Yes, it is working fine. Uses the original XNA function.
Indeed. You need to set Guide.SimulateTrialMode if you want to be able to test using the Guide.IsTrialMode property.
For debugging purposes, I usually set Guide.SimulateTrialMode based on the result of a popup I display at the start, so I can easily choose a different mode by simply restarting the app and choosing the other option.
Also - and this might have changed as it’s a while since I worried about this - SimulateTrialMode does not work when building under release configuration, from what I remember.
Yeah that part sucks… I can’t even test out my game in trial mode even through WP Beta testing…
A release build should not be functionally different from a debug build, so I don’t quite get why this would be an issue.
Just make sure everything works the way you want it to in debug mode and then build and run the release version when you want to submit it for review.
The thing is you can’t test everything in debug mode. For instance, my game has a menu which will refresh after the player unlocks the full version of the game. The auto-refresh mechanic was working well in debug mode, but not in the WP release build, because I can’t test it even with the WP Beta program
[quote=“greyp, post:9, topic:1961”]
The auto-refresh mechanic was working well in debug mode, but not in the WP release build, because I can’t test it even with the WP Beta program
[/quote]What issues are you running into, exactly? Like I said, there should be no noticeable differences between a debug and a release build. If your app properly transitions from trial to full in debug mode, it’s safe to assume it works in release mode also.
Not necessarily… For example, when the “Purchase Full Game” button gets tapped in debug mode, it can directly calls a function to simply flip a flag and refresh the UI. While in a release build, the UI refresh can’t be performed before the value of Guide.IsTrialMode changes. I therefore changed the detection mechanic and let the game check the value of my IsTrial wrapper once per second. Theoretically it should work, but since you can’t test it without submitting it to WP Store, you can never be 100% sure…
Ah, I see what you mean.
Personally, I’d cache the IsTrialMode value somewhere, initialize it during the Startup/Initialize event and update it in the app’s Activated event. This will ensure that the value is updated when the app starts, and when it resumes, for example, after purchasing it.
see https://msdn.microsoft.com/en-us/library/dd282459.aspx and https://msdn.microsoft.com/library/windows/apps/ff967558(v=vs.105).aspx for some additional hints.
Ah I see. That is smarter than what I did!