Reputation: 13
I added a trial version to my WP7 app but when I deploy the app on a windows phone device in release mode, it runs the full version of the application instead of trial version. So I am worring about when I submit my app, what if people can use my app's full version without purchasing it. Or it's maybe what it's supposed to be before submitting the app or installing to the phone through this way but I coundn't find any information about it. Here is my code samples.
In App.xaml, I set LicenceInformation.IsTrial to a static bool variable for caching.
public static bool IsTrial
{
get;
private set;
}
private void DetermineIsTrial()
{
#if TRIAL
IsTrial = true;
#else
var license = new Microsoft.Phone.Marketplace.LicenseInformation();
IsTrial = license.IsTrial();
#endif
}
private void Application_Launching(object sender, LaunchingEventArgs e)
{
DetermineIsTrial();
}
private void Application_Activated(object sender, ActivatedEventArgs e)
{
DetermineIsTrial();
}
Then I check if it is trial version or full by this way.
if(App.IsTrial)
{
//Trial Version
}
else
{
//Full Version
}
So I've done all the trial and full version tests and it's ready to submit but when deploying it to a windows phone device in release mode, isn't it suppose to run the trial version instead of full version? Any help will be appreciated.
Regards.
Upvotes: 1
Views: 2063
Reputation: 9604
It looks like this is doing what is expected - your app isn't on Marketplace yet, so the IsTrial
flag is defaulting to false.
See How to: Implement a Trial Experience in a Silverlight Application for Windows Phone.
Real license information is available for an application only after it has been published to the Windows Phone Marketplace.
Trying a blank Windows Phone project just with the following code added to the main page gives false
too.
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
var license = new Microsoft.Phone.Marketplace.LicenseInformation();
bool isT = license.IsTrial();
}
Upvotes: 3
Reputation: 84754
That depends, do you define the TRIAL
compilation variable in your release configuration?
If so, you'll need to remove it.
Update
This is the expected behavior, as per How to: Test and Debug your Trial Application for Windows Phone:
When debugging in the Windows Phone Emulator or testing on an unlocked device, your application must simulate trial mode. In these cases, which are generally called debug mode, the IsTrial method always returns false
Upvotes: 3