Skip to content

Latest commit

 

History

History
33 lines (23 loc) · 2.06 KB

storeproduct_requestpurchaseasync_1703896342.md

File metadata and controls

33 lines (23 loc) · 2.06 KB
-api-id -api-type
M:Windows.Services.Store.StoreProduct.RequestPurchaseAsync(Windows.Services.Store.StorePurchaseProperties)
winrt method

Windows.Services.Store.StoreProduct.RequestPurchaseAsync

-description

Requests the purchase of the default SKU and availability for the product and displays the UI that is used to complete the transaction via the Microsoft Store. This method provides the option to specify additional details for a specific offer within a large catalog of products that are represented by a single listing in the Microsoft Store, including the product name to display to the user during the purchase.

Important

This method must be called on the UI thread.

-parameters

-param storePurchaseProperties

An object that specifies additional info for the purchase request, including the product name to display to the user during the purchase.

-returns

An asynchronous operation that, on successful completion, returns a StorePurchaseResult object that provides status and error info about the purchase.

-exceptions

T:System.Runtime.InteropServices.COMException

If the ErrorCode property of the exception has the value 0x80070578 (ERROR_INVALID_WINDOW_HANDLE), this indicates that the method was not called on the UI thread. If you are calling this method in a desktop application that uses the Desktop Bridge, this can also indicate that you did not configure the StoreContext object to specify which application window is the owner window for modal dialogs shown by this method. For more information, see this article.

-examples

-see-also

RequestPurchaseAsync, Enable in-app purchases of apps and add-ons