Search code examples
uwpwindows-store-appswin-universal-app

How to provide option to purchase app within app (UWP - Windows 10)


Is there a way to provide a user with the option to buy an app within the app (by this I mean your own app) itself? I'd swear I've seen this before and maybe it was only in windows phone but I'd like to offer this within my UWP app.

I thought of redirecting the user to the store (still have to figure this one) but I didn't think it would be too user friendly having to be redirected first, then what? Uninstall the app and re-install or would the app know by inspecting the local WindowsStoreProxy.xml?

I've read about IAP, but I don't think purchasing the full app falls in that category.

I'm not even sure that's what it's doing but I just can't find any clear explanations on how the whole process is done.

Between Advertising and licensing, I don't know which one is worse!! Very poorly explained by Microsoft. There's lots of documentation but huge holes in them making it hard to decipher what is probably a simple process!

Any feedback, links to relevant articles would be appreciated.

Thanks


Solution

  • To purchase the app itself, we can set a Base price and Free trial for the app when you create a submission. For more info, please see Set app pricing and availability.

    And in the app, we can pick the features that we want to enable or disable during the trial period. See Exclude or limit features in a trial version for details.

    When the trial expires, you can refer to the following options to handle them:

    • Trial license expires while the app is running

      If the trial expires while your app is running, your app can:

      • Do nothing.
      • Display a message to your customer.
      • Close.
      • Prompt your customer to buy the app.

      The best practice is to display a message with a prompt for buying the app, and if the customer buys it, continue with all features enabled. If the user decides not to buy the app, close it or remind them to buy the app at regular intervals.

    • Trial license expires before the app is launched

      If the trial expires before the user launches the app, your app won't launch. Instead, users see a dialog box that gives them the option to purchase your app from the Store.

    To buy the app, we can call CurrentApp.RequestAppPurchaseAsync | requestAppPurchaseAsync method. This method requests the purchase of a full app license.

    There is also a Store sample in Github which demonstrates trials and purchasing the app itself. You can refer to its first Trials-Mode scenario. But please note, in this sample, it uses CurrentAppSimulator class for testing. You must replace the CurrentAppSimulator class with the CurrentApp class before you submit the app to the Windows Store.