Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Managing the Free version of my app

My paid app has been published on the WP7 marketplace. Now I would like to create a free version of the app.

I figure I would have a constant IsFreeVersion = true; and then based on that disable some functionality.

What would be the best approach to setting up my project for this? I definitely do not want to have two versions of the code. So should I create a new project and link the files?

Also, how do I handle the different application icons? Finally, wouldn't I need a separate GUID for my application Id?

like image 504
Cloud SME Avatar asked Jun 21 '11 18:06

Cloud SME


3 Answers

If you want to have a Free and Paid version of your app in the same project without using a 'Trial' version, this is how I do it:

Each project is assigned a single ProductID which distinguishes the app from other apps at install time. You could create a second project and link to all the files in the first project, but that would require maintenance as the project grows. My solution allows using the Build Configuration to select the free or paid app to build.

First you need a separate ProductID for each version of the app. This ProductID is declared in the manifest file 'Properties/WMAAppManifest.xml'. So the first step is to create two versions of WMAAppManifest.xml. I call them WMAAppManifestPaid.xml and WMAAppManifestFree.xml.

In each of these manifest files, provide a separate GUID for the ProductID and also change the Title of the free version so you can tell them apart when they are installed.

Next we need to add two new Build Configurations in the project. I call them ReleaseFree and DebugFree.

Next you add a few Pre-Build Events to all the build configuations to copy the appropriate manifest file:

if $(ConfigurationName)==Release copy $(ProjectDir)\Properties\WMAppManifestPaid.xml $(ProjectDir)\Properties\WMAppManifest.xml if $(ConfigurationName)==Debug copy $(ProjectDir)\Properties\WMAppManifestPaid.xml $(ProjectDir)\Properties\WMAppManifest.xml if $(ConfigurationName)==ReleaseFree copy $(ProjectDir)\Properties\WMAppManifestFree.xml $(ProjectDir)\Properties\WMAppManifest.xml if $(ConfigurationName)==DebugFree copy $(ProjectDir)\Properties\WMAppManifestFree.xml $(ProjectDir)\Properties\WMAppManifest.xml

You should now be able to build either the free or paid versions of the app by simply changing the Build Configuration.

Next, to allow for actually making the free version different than the paid version, such as limiting features, showing different pages etc., you need to add a Conditional Compilation Symbol, such as FREE_VERSION to the two free build configurations.

then you can simply use compiler directives to change the code such as:

#if FREE_VERSION
    s = "My App Free";
#else
    s = "My App Paid";
#endif
like image 143
Jon Avatar answered Feb 08 '23 14:02

Jon


If you want separate apps for the free and paid versions (Presumably you're limiting the functionality of the free app or adding ads) then I'd create a separate project and then link to the exisiting files of the other (use "add as link").

You can then customize the different versions as necessary. When doing things like this I like to use partial methods (and classes) to extend and customize the different versions.
You may also want to use app specific compiler directives to limit functionality to a specific version.

like image 30
Matt Lacey Avatar answered Feb 08 '23 14:02

Matt Lacey


The Trial API is designed to handle such a situation. You can check if IsTrial is true, in which case you can limit functionality all in one code base. I assume you avoided this in order to ensure your app appears in the Free section of the Marketplace. In this case, you'll have to submit it as a new app, which means a new GUID.

AFAIK (maybe someone has another method), you'll have to create a new project and run a separate build. You can include your existing code base for the most part, but you'll end up with two versions if you don't include the Trial API. Since it's a new project, you can change the tile icons to whatever you want.

like image 30
keyboardP Avatar answered Feb 08 '23 15:02

keyboardP