Search code examples
windows-8in-app-purchasein-app-billingwindows-store-appswindows-store

Windows Store In-App purchases (addons, consumables, subscriptions)?


  1. Is it possible to have the following items be purchased through the Windows Store as in-app purchases?
    • Add-On
    • Consumables (One-Time Usage)
    • Subscriptions

  2. Where can I find resources on how to code in in-app purchases for Addons, Consumables, Subscriptions?

Yes, I have attempted to google examples, but I can't seem to have any luck finding anything on some of these other than tech articles about Windows 8 rather than dev blogs/articles.


Solution

  • To support in-app purchases do the following:

    1. Setup your app for licensing using the LicenseInformation class (this class also is where you put time limits on the purchase for subscriptions).

    2. Name as code the feature in your app:

    if (licenseInformation.productLicenses.lookup("featureName").isActive) 
    {
        // the customer can access this feature
    }
    else 
    {
        // the customer can't access this feature
    }
    
    1. Configure the in-app offer in the Windows Store

    Before you submit your app to the store, add each in-app offer to the Advanced features page in the Submit an app workflow. This is where you specify the in-app offer's token, price, and feature lifetime. Make sure that you configure it identically to the configuration you set in WindowsStoreProxy.xml when testing, or all of that hard work you spent testing may be wasted!

    There is currently no support for consumables (unless maybe you're using the xbox live api?). See here for more details and a workaround.