Share via


StorePreview.RequestProductPurchaseByProductIdAndSkuIdAsync Method

Definition

Requests the purchase of a SKU for an in-app product that is associated with the current app. Calling this method displays the UI that is used to complete the transaction via the Microsoft Store.

public:
 static IAsyncOperation<StorePreviewPurchaseResults ^> ^ RequestProductPurchaseByProductIdAndSkuIdAsync(Platform::String ^ productId, Platform::String ^ skuId);
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<StorePreviewPurchaseResults> RequestProductPurchaseByProductIdAndSkuIdAsync(winrt::hstring const& productId, winrt::hstring const& skuId);
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<StorePreviewPurchaseResults> RequestProductPurchaseByProductIdAndSkuIdAsync(string productId, string skuId);
function requestProductPurchaseByProductIdAndSkuIdAsync(productId, skuId)
Public Shared Function RequestProductPurchaseByProductIdAndSkuIdAsync (productId As String, skuId As String) As IAsyncOperation(Of StorePreviewPurchaseResults)

Parameters

productId
String

Platform::String

winrt::hstring

Specifies the ID of the in-app product. This corresponds to the StorePreviewProductInfo.ProductId value and the StorePreviewSkuInfo.ProductId values for all SKUs of the in-app product.

skuId
String

Platform::String

winrt::hstring

Specifies the ID of the SKU for the in-app product. This corresponds to the StorePreviewSkuInfo.SkuId value.

Returns

An asynchronous operation that, on successful completion, returns a StorePreviewPurchaseResults that contains the results of the in-app product purchase request.

Attributes

Windows requirements

App capabilities
previewStore

Remarks

The StorePreviewSkuInfo.ProductId and StorePreviewProductInfo.ProductId values are not the same as the Windows.ApplicationModel.Store.ProductListing.ProductId value. Windows.ApplicationModel.Store.ProductListing.ProductId is specified by the developer as they create an in-app product in Partner Center. The StorePreviewSkuInfo.ProductId and StorePreviewProductInfo.ProductId values are generated by Microsoft.

Applies to

See also