語言

CurrentApp.RequestProductPurchaseAsync 方法

定義

多載

名稱 Description
RequestProductPurchaseAsync(String)

Important

在提升級應用程式中不支援應用程式內購買功能。

要求購買附加元件(也稱為應用程式內產品或 IAP)。 此外,呼叫此方法會顯示用來透過 Microsoft Store 完成交易的 UI。

RequestProductPurchaseAsync(String, Boolean)

Important

在提升級應用程式中不支援應用程式內購買功能。

注意

[RequestProductPurchaseAsync(String, Boolean) 可能會在Windows 8.1之後變更或無法使用版本。 請改用 RequestProductPurchaseAsync(String)。

要求購買附加元件(也稱為應用程式內產品或 IAP)。 此外,呼叫此方法會顯示用來透過 Microsoft Store 完成交易的 UI。

RequestProductPurchaseAsync(String, String, ProductPurchaseDisplayProperties)

Important

在提升級應用程式中不支援應用程式內購買功能。

要求購買附加元件(也稱為應用程式內產品或 IAP)。 此外,呼叫此方法會顯示用來透過 Microsoft Store 完成交易的 UI。 此多載包含參數,可用來在市集中單一產品專案所代表的大型應用程式內購買目錄中,顯示特定供應專案的詳細數據。

RequestProductPurchaseAsync(String)

Important

在提升級應用程式中不支援應用程式內購買功能。

要求購買附加元件(也稱為應用程式內產品或 IAP)。 此外,呼叫此方法會顯示用來透過 Microsoft Store 完成交易的 UI。

public:
 static IAsyncOperation<PurchaseResults ^> ^ RequestProductPurchaseAsync(Platform::String ^ productId);
/// [Windows.Foundation.Metadata.Overload("RequestProductPurchaseWithResultsAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<PurchaseResults> RequestProductPurchaseAsync(winrt::hstring const& productId);
[Windows.Foundation.Metadata.Overload("RequestProductPurchaseWithResultsAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<PurchaseResults> RequestProductPurchaseAsync(string productId);
function requestProductPurchaseAsync(productId)
Public Shared Function RequestProductPurchaseAsync (productId As String) As IAsyncOperation(Of PurchaseResults)

參數

productId
String

Platform::String

winrt::hstring

要購買之附加元件的產品標識碼。

傳回

PurchaseResults,其中包含應用程式內產品購買要求的結果。

屬性

備註

產品標識碼是應用程式用來識別附加元件的字串。 當您 合作夥伴中心提交附加元件 時,您會輸入產品標識碼,其與描述、價格區間和存留期相關聯。 如需詳細資訊,請參閱 如何在程式代碼中使用附加元件的產品識別子。

您可以在 程式代碼範例中看到如何使用此方法的範例。

另請參閱

適用於

RequestProductPurchaseAsync(String, Boolean)

Important

在提升級應用程式中不支援應用程式內購買功能。

注意

[RequestProductPurchaseAsync(String, Boolean) 可能會在Windows 8.1之後變更或無法使用版本。 請改用 RequestProductPurchaseAsync(String)。

要求購買附加元件(也稱為應用程式內產品或 IAP)。 此外,呼叫此方法會顯示用來透過 Microsoft Store 完成交易的 UI。

public:
 static IAsyncOperation<Platform::String ^> ^ RequestProductPurchaseAsync(Platform::String ^ productId, bool includeReceipt);
/// [Windows.Foundation.Metadata.Deprecated("RequestProductPurchaseAsync(productId, includeReceipt) may be altered or unavailable for releases after Windows 8.1. Instead, use RequestProductPurchaseAsync(productId).", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.Overload("RequestProductPurchaseAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<winrt::hstring> RequestProductPurchaseAsync(winrt::hstring const& productId, bool const& includeReceipt);
/// [Windows.Foundation.Metadata.Overload("RequestProductPurchaseAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
/// [Windows.Foundation.Metadata.Deprecated("RequestProductPurchaseAsync(productId, includeReceipt) may be altered or unavailable for releases after Windows 8.1. Instead, use RequestProductPurchaseAsync(productId).", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
 static IAsyncOperation<winrt::hstring> RequestProductPurchaseAsync(winrt::hstring const& productId, bool const& includeReceipt);
[Windows.Foundation.Metadata.Deprecated("RequestProductPurchaseAsync(productId, includeReceipt) may be altered or unavailable for releases after Windows 8.1. Instead, use RequestProductPurchaseAsync(productId).", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.Overload("RequestProductPurchaseAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<string> RequestProductPurchaseAsync(string productId, bool includeReceipt);
[Windows.Foundation.Metadata.Overload("RequestProductPurchaseAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
[Windows.Foundation.Metadata.Deprecated("RequestProductPurchaseAsync(productId, includeReceipt) may be altered or unavailable for releases after Windows 8.1. Instead, use RequestProductPurchaseAsync(productId).", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
public static IAsyncOperation<string> RequestProductPurchaseAsync(string productId, bool includeReceipt);
function requestProductPurchaseAsync(productId, includeReceipt)
Public Shared Function RequestProductPurchaseAsync (productId As String, includeReceipt As Boolean) As IAsyncOperation(Of String)

參數

productId
String

Platform::String

winrt::hstring

要購買之附加元件的產品標識碼。

includeReceipt
Boolean

bool

判斷方法是否應該傳回指定之 productId 的收據。

傳回

IAsyncOperation<String>

IAsyncOperation<Platform::String>

IAsyncOperation<winrt::hstring>

字串,提供所提供之 productId的應用程式內交易詳細數據。 如果設定 includeReceipttrue,則傳回的字串會包含完整的收據 xml。

屬性

備註

RequestProductPurchaseAsync(String) 的備註也適用於此多載。

若要確認產品授權在成功呼叫此多載之後是否為使用中,請使用 LicenseInformation.IsActive 屬性。

另請參閱

適用於

RequestProductPurchaseAsync(String, String, ProductPurchaseDisplayProperties)

Important

在提升級應用程式中不支援應用程式內購買功能。

要求購買附加元件(也稱為應用程式內產品或 IAP)。 此外,呼叫此方法會顯示用來透過 Microsoft Store 完成交易的 UI。 此多載包含參數,可用來在市集中單一產品專案所代表的大型應用程式內購買目錄中,顯示特定供應專案的詳細數據。

public:
 static IAsyncOperation<PurchaseResults ^> ^ RequestProductPurchaseAsync(Platform::String ^ productId, Platform::String ^ offerId, ProductPurchaseDisplayProperties ^ displayProperties);
/// [Windows.Foundation.Metadata.Overload("RequestProductPurchaseWithDisplayPropertiesAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<PurchaseResults> RequestProductPurchaseAsync(winrt::hstring const& productId, winrt::hstring const& offerId, ProductPurchaseDisplayProperties const& displayProperties);
[Windows.Foundation.Metadata.Overload("RequestProductPurchaseWithDisplayPropertiesAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<PurchaseResults> RequestProductPurchaseAsync(string productId, string offerId, ProductPurchaseDisplayProperties displayProperties);
function requestProductPurchaseAsync(productId, offerId, displayProperties)
Public Shared Function RequestProductPurchaseAsync (productId As String, offerId As String, displayProperties As ProductPurchaseDisplayProperties) As IAsyncOperation(Of PurchaseResults)

參數

productId
String

Platform::String

winrt::hstring

要購買之附加元件的產品標識碼。

offerId
String

Platform::String

winrt::hstring

productId 在 Microsoft Store 上表示的大型購買類別目錄內特定應用程式內功能或內容。 此值與應用程式負責完成的內容相互關聯。 Microsoft Store 只會使用此值來將 PurchaseResults專案化。

displayProperties
ProductPurchaseDisplayProperties

購買時向用戶顯示的應用程式功能或內容供應項目名稱。

傳回

PurchaseResults,其中包含應用程式內產品購買要求的結果。

屬性

備註

RequestProductPurchaseAsync(String) 的備註也適用於此多載。

另請參閱

適用於