Trial version or 2 apps, 1 limited and 1 pro? RRS feed

  • General discussion

  • I'm aware that there are ways for the user to trick the app into upgrading to full from trial without paying. 

    I'm about to publish a paid app.  I'm thinking of making 1 version free but limited and 1 pro with all features enabled.  Couple questions.  Does MS allow this?  Should I do this or should I just stick with creating a trial version?

    PS - I'm finding very limited documentation on how to make a trial version for c++. 

    Thursday, June 27, 2013 7:27 AM

All replies

  • For language agnostic documentation see How to create a trial version of your app .

    The Trial app and in-app purchase sampleis available in C++

    You can have a free and a paid version. That won't give a smooth upgrade for users, so you may make fewer sales that way than if you provide a trial. For more discussion on this see the Publishing Windows Store apps forum.

    Publishing Windows Store apps
    Publishing and distributing Windows Store apps for Windows 8
    Announcements : 0


    Thursday, June 27, 2013 8:45 AM
  • For language agnostic documentation see How to create a trial version of your app .

    The Trial app and in-app purchase sampleis available in C++

    You can have a free and a paid version. That won't give a smooth upgrade for users, so you may make fewer sales that way than if you provide a trial. For more discussion on this see the Publishing Windows Store apps forum.

    Publishing Windows Store apps
    Publishing and distributing Windows Store apps for Windows 8
    Announcements : 0


    Forgive me for being a newbie.  But from your link, there's no c++ documentation.

    I've downloaded the trial app and in app purchase sample.  Trying to understand it now.  Following an example without much documentation is harder for people like me who haven't been formally trained than you think.

    This brings up this question.   I've noticed that most documentations are for VB and C# but no C++ code.  Why is this?

    Thursday, June 27, 2013 3:22 PM
  • While you are here, can you please help me with how to make a trial app and making it purchasable within the app?  There is zero c++ documentation on this.  There's an example...


    I'm really having trouble understanding this.  I tried copying and pasting the code into my own code, but it just won't work.  There's documentation for c#, but for some reason they hate c++.

    Sunday, June 30, 2013 2:59 PM
  • Hi.  I have a simple "Hello World" app that is configured as a trial with the option to purchase the full license in-app.  It is written in C# but I am porting it to C++.  Should be done later today.

    • Edited by jrboddie Sunday, June 30, 2013 6:55 PM post was moved. made post consistent with current location
    Sunday, June 30, 2013 5:09 PM
  • The descriptions in the documentation apply to all languages. The API calls in the code snippets are the same as you'd use in C++ with minor syntax differences from C#. You can find the full C++ syntax in the sample.


    Sunday, June 30, 2013 5:26 PM
  • I just published my Trial Hello World App on SkyDrive.  Written in C++/CX it is essentially the same trial logic that I used for my C# based QuakeView app in the store.

    The main function of the Hello World app is to display 'Hello World" and the time when a button is clicked.  This function will work when the app is in trial mode and or active.  A small panel is displayed in the lower right corner of the page when in trial mode indicating the number of days left in the trial and offering a button to click for in-app purchase.  When the app is purchased, the box is no longer displayed.

    Errors in purchasing are handled with appropriate updates to the status panel.

    In debug mode, the app reads from the trial-mode.xml file to create a CurrentAppSimulator proxy.  You can modify the xml file to simulate various license conditions.  When compiled for release, the app will use CurrentApp to get license information.

    Of course, the code has not been exhaustively tested and is offered "as is" with no claim of correctness.

    Sunday, June 30, 2013 9:56 PM
  • Thank you so much for the code.  It is much much easier to understand.  Can't wait to implement it in my code. 

    Why do you think c++ examples out there are so lacking?  It seems like everywhere I click under c++ it always says currently not available.  Does MS want people to code in VB and c#?

    Added by edit.

    Forgive my ignorance.  Instead of placing a limit on the number of days the trial could be used, I could just make the trial forever but placing limits on the contents displayed in the app.  Where do I change the values?

    • Edited by RandyPete Monday, July 1, 2013 3:21 AM add content
    Monday, July 1, 2013 2:51 AM
  • If you are doing a trial with no time limit but with restricted functionality, then conditionally control portions of your app with licenseInformation->IsTrial

    #ifdef _DEBUG
    	auto licenseInformation = CurrentAppSimulator::LicenseInformation; 
    	auto licenseInformation = CurrentApp::LicenseInformation; 
    	if (!licenseInformation->IsTrial)
    		//Will not execute unless fully licensed (no trial)
    Of course, you would not use the sections of my example that report number of days remaining in the trial.

    Monday, July 1, 2013 11:53 AM
  • Forgive my ignorance.

    What I don't understand is why your code doesn't need to include the following "concrt.h" and <ppltasks.h> but I have to include them in order to get rid of the errors?

    Also, I've written it so that the mainpage xaml will not open up certain contents (other xaml pages) unless the app has been bought.  But everytime I bought it, go into the contents in another xaml page, and then press the back button, the trial and buy now box appeared again.  Is this normal? 

    Is there a way I know for sure having a license will keep contents available?

    • Edited by RandyPete Monday, July 15, 2013 4:15 AM more questions
    Monday, July 15, 2013 2:55 AM
  • I put some header references in pch.h.  I did not need concrt.h.

    // pch.h
    // Header for standard system include files.
    #pragma once
    #include <ppltasks.h> 
    #include <collection.h>
    #include "App.xaml.h"

    Monday, July 15, 2013 3:09 AM
  • (1) You're an angel.  I don't know how I could have done all of this without you.

    (2) You are an amazing person.

    (3) I feel like an idiot.  Don't know why I never checked pch.h.

    (4) I added a question to my previous post after you replied. 

    Basically speaking, every time I navigate away from the mainpage, the trial stackpanel appeared again and I have to "buy" the app again.  Is it suppose to behave this way?

    Monday, July 15, 2013 4:48 AM
  • I didn't design the sample for a multi-page app so there are a couple of problems that cause your symptoms:

    1. When you navigate back to the MainPage in Debug Mode, the proxy file for the CurrentAppSimulator is reloaded.  This essentially resets your license to the state it was in when you started the app.  The solution is to load the proxy file only when the app is first started and not each time the page is created.
    2. When you navigate back to the MainPage, it is created as it was when first run--that is, the trial status panel is visible.  The solution is to call UpdateTrialStatusPanel when the page is loaded (and after the license info is acquired.

    For the first solution, I guess you could put the trial logic in the App class but to make things simple, I created a static bool in App to track the state of the CurrentAppSimulator.

    In App.xaml.h add the following public property

    		property static bool CurrentAppSimIsInit;

    Initialize it in App.xaml.cpp

    	CurrentAppSimIsInit = false;

    In the MainPage.xaml.cpp InitializeTrialPlumbing method make the call to LoadTrialModeProxyFile conditional and set the bool to true.

    void MainPage::InitalizeTrialPlumbing()
    #ifdef _DEBUG	
    	if (App::CurrentAppSimIsInit == false)
    		App::CurrentAppSimIsInit = true;

    To solve the second problem just call 


    at the end of your OnNavigatedTo or LoadState method (depending on which one you are using.)  You would also update any other UI elements that are dependent on license status here as well.

    BTW, I also had to unregister the event handlers when navigating away from the MainPage.

    • Edited by jrboddie Monday, July 15, 2013 1:27 PM added comment
    Monday, July 15, 2013 1:20 PM
  • Thank you very much for solving this problem for me. 

    I need to add that based on your method alone, one would have to navigate away from the mainpage after the app is bought and then come back to it for the features to unlock.  Here's how I solved it for those who came to this thread searching for the same answers.

    To solve this, I added

    //In-app purchase from this button click
    void FEPrepMath::MainPage::PurchaseApp_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
    				if (licenseInformation->IsActive && !licenseInformation->IsTrial) 
    					RemainingTime->Text = "Thank you!";

    After this, everything works perfectly.

    Submitting it now for publication.  I'll start on the next app tonight when I get back home.  The next app should take a lot less time, now that I've learned all of this.

    A side note.  I got my degree in structural engineering, not comp science.  This is why I'm running into all the problems that comp science students were suppose to run into in college.  Something as simple as making namespace concurrency work took me a long long time.  Thank god I have a day job.

    Anyway, please bear with me. 

    Monday, July 15, 2013 3:12 PM
  • Hey jrboddie,

    Can you please give me the C# trial version?  I've moved over to C# and the sample is kicking my ass.  I've spent 2 hours on it and still couldn't make the C# trial to work.  Your code makes a lot more sense.  Thank you.

    Tuesday, August 13, 2013 4:50 PM
  • Here you go: HelpWithTrialLicense on Skydrive.

    Tuesday, August 13, 2013 5:15 PM
  • You should submit your code to the sample archive.  Like I said, I spent about 2 hours until my eyes were crossed and I still couldn't make the code from the sample to work.  Took me about 5 minutes to modify your code to what I wanted and the app was ready to be submitted to the winstore.  In fact, I submitted it already.

    Why are sample codes written in such complicated ways when there are much easier ways to write them?  I started out exploring the sample codes before I came here.  Ever since I came and with your help, I've learned way way more than when I was fumbling around with the sample codes.  This is why it drives me up the wall whenever someone answers a question by posting a link to a sample code. 

    Wednesday, August 14, 2013 2:59 AM