I've been developing and testing WP apps for more than year, including paid apps with trial versions, Silverlight and XNA too. When using Guide.SimulateTrialMode and Guide.IsTrial in WP7 SDK, it was perfectly working in emulator and on real device as well. Now when I use this same approach in WP8 SDK for WP8 apps, when I set SimulateTrialMode to true, then Guide.IsTrial still returns false. I've even tried LicenseInformation.IsTrial() and it is returning false as well.
The question is, am I doing something wrong, or it is no longer possible to simulate the trial mode using Guide.SimulateTrialMode in WP8 apps? Note when I use this for WP7.1 apps with WP8 SDK, it works just fine, so I guess it's only bug in WP8 apps.
I've checked these guides, but there is no hint that SimulateTrialMode is broken on WP8:
Creating trial apps for Windows Phone
Guide.SimulateTrialMode Property
App platform compatibility for Windows Phone
tl;dr SimulateTrialMode is not working in WP8 apps, any other way, how to simulate Trial mode?
The way I do it is, instead of calling directly Guide.IsTrialMode
, I wrap it in a property:
public static bool IsTrial
{
get
{
return Guide.IsTrialMode;
}
}
The point is that you can now easily change the property to return true or false during your test. You can even use preprocessor directives and a specific build configuration to switch to trial mode:
public static bool IsTrial
{
get
{
#if TRIAL
return true;
#else
return Guide.IsTrialMode;
#endif
}
}