In Windows 8, the in-app purchases supported by any given version of an app must be defined with a product ID when the app is uploaded to the Windows Store. This means that you have to update the app in the Store to add additional product IDs. This can pose a challenge to apps that want to offer more dynamic content through in-app purchases, especially media content like books, recipe collections, and so on, where those content collections aren’t necessarily known ahead of time.

In these cases, and app can still download content once a license for the product ID is purchases; the Windows Store doesn’t produce a mechanism for download-on-purchase, but an app can certainly do that itself.

To work with dynamic purchases, the trick is to define a number of placeholder IDs for future in-app purchases when uploading the app. At runtime, when creating your in-app purchase UI, you’ll retrieve the list of product ID from the WinRT API, then have your service (likely the one from which you’d download the content), check those IDs and tell you which ones are presently valid, that is, which ones have real content assigned to them. The app then only displays those products are valid and ignores the rest.

Later on, if the user returns to the in-app purchase UI, additional content might be available and would thus appear. Of course, such an app would likely check with the service periodically to know when new content has been added so it can alert the user and encourage a new purchase!

Comments are closed