Managing Windows Phone 7 Trial Applications
- Posted: Aug 30, 2010 at 11:29 AM
- 5,323 Views
Right click “Save as…”
Windows Phone 7 provides the LicenseInformation class that includes the IsTrial() method. IsTrial() allows you to check, at runtime, if the running application has been installed from the Marketplace as a trial application, or if the user has purchased the application. Developers are able to use IsTrial() to change the behavior of their application based on whether or not the user is running a trial version or a paid for version. Unfortunately for WP7 devs, there is no easy way to control the IsTrial() results when developing and debugging their applications. IsTrial() will always return False when developing an application. Even more disappointing, LicenseInformation is a sealed class and there is no ILicenseInfo interface that you could use to mock out your own implementation while developing.
In addition, each developer is left to his or her own devices to come up with a system for controlling how their trial software behaves. Simple things like turning off features in the trial version is pretty straightforward, but if you want to have more complex behavior, things get trickier. What if you want someone to be able to use your application for 30 days before you disable features? How about 10 uses of the application before they need to buy the full version? You are on your own.
TrialManager is a simple piece of code that you can add to any WP7 project to help manage the behavior of your trial apps. TrialManager will also make it easier to simulate you application running in Trial mode when creating your apps. You can get the source to TrialManager here. Feel free to use it, modify, etc. The only licensing restriction is that I ask you send me an email, letting me know you are using the code in some form or fashion.