title | description | author | ms.author | ms.date | ms.topic | keywords |
---|---|---|---|---|---|---|
In-app purchases |
Learn how to use in-app purchases in your mixed reality apps with 2D XAML views and stock Windows OS popup. |
thetuvix |
alexturn |
03/21/2018 |
article |
in-app purchases, hololens, XAML, mixed reality headset, windows mixed reality headset, virtual reality headset |
In-app purchases are supported in HoloLens, but there's some work to set them up.
To use the in app-purchase functionality, you must:
- Create a XAML 2D view to appear as a slate
- Switch to it to activate placement, which leaves the immersive view
- Call the API: await CurrentApp.RequestProductPurchaseAsync("DurableItemIAPName");
This API will bring up the stock Windows OS popup that shows the in-app purchase name, description, and price. The user can then choose purchase options. Once the action is completed, the app will need to present UI, which allows the user to switch back to its immersive view.
For apps targeting desktop-based Windows Mixed Reality immersive headsets, it isn't required to manually switch to a XAML view before calling the RequestProductPurchaseAsync API.