CurrentAppSimulator.RequestProductPurchaseAsync Methode

Definition

Überlädt

RequestProductPurchaseAsync(String)

Erstellt den asynchronen Vorgang, der die Benutzeroberfläche anzeigt, die zum Simulieren des Kaufs eines Add-Ons (auch als In-App-Produkt oder IAP bezeichnet) aus dem Microsoft Store verwendet wird.

RequestProductPurchaseAsync(String, Boolean)

Hinweis

[RequestProductPurchaseAsync(String, Boolean) kann für Releases nach Windows 8.1 geändert oder nicht mehr verfügbar sein. Verwenden Sie stattdessen RequestProductPurchaseAsync(String).

Erstellt den asynchronen Vorgang, der die Benutzeroberfläche anzeigt, die zum Simulieren des Kaufs eines Add-Ons (auch als In-App-Produkt oder IAP bezeichnet) aus dem Microsoft Store verwendet wird.

RequestProductPurchaseAsync(String, String, ProductPurchaseDisplayProperties)

Erstellt den asynchronen Vorgang, der die Benutzeroberfläche anzeigt, die zum Simulieren des Kaufs eines Add-Ons (auch als In-App-Produkt oder IAP bezeichnet) aus dem Microsoft Store verwendet wird. Diese Überladung umfasst Parameter, die Sie verwenden können, um Details für ein bestimmtes Angebot in einem großen Katalog von In-App-Käufen anzuzeigen, der durch einen einzelnen Produkteintrag im Store dargestellt wird.

RequestProductPurchaseAsync(String)

Erstellt den asynchronen Vorgang, der die Benutzeroberfläche anzeigt, die zum Simulieren des Kaufs eines Add-Ons (auch als In-App-Produkt oder IAP bezeichnet) aus dem Microsoft Store verwendet wird.

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)

Parameter

productId
String

Platform::String

winrt::hstring

Die Produkt-ID (wie in der Simulation definiert) des zu erwerbenden Add-Ons.

Gibt zurück

Ein PurchaseResults-Objekt , das die Ergebnisse der simulierten In-App-Produktkaufanforderung enthält.

Attribute

Hinweise

Verwendet das CurrentApp/ListingInformation/Product-Element in der WindowsStoreProxy.xml-Datei mit dem ProductId-Attribut , das ProductId als Datenquelle für die Member des zurückgegebenen Objekts entspricht. Wenn der Kauf erfolgreich ist, wird der Lizenzstatus nur im Arbeitsspeicher aktualisiert. Der Inhalt von WindowsStoreProxy.xml wird nicht geändert. Weitere Informationen finden Sie unter Verwenden der WindowsStoreProxy.xml-Datei mit CurrentAppSimulator.

Ein Beispiel für die Verwendung dieser Methode finden Sie in unserem Codebeispiel.

Weitere Informationen

Gilt für:

RequestProductPurchaseAsync(String, Boolean)

Hinweis

[RequestProductPurchaseAsync(String, Boolean) kann für Releases nach Windows 8.1 geändert oder nicht mehr verfügbar sein. Verwenden Sie stattdessen RequestProductPurchaseAsync(String).

Erstellt den asynchronen Vorgang, der die Benutzeroberfläche anzeigt, die zum Simulieren des Kaufs eines Add-Ons (auch als In-App-Produkt oder IAP bezeichnet) aus dem Microsoft Store verwendet wird.

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)

Parameter

productId
String

Platform::String

winrt::hstring

Die Produkt-ID (wie in der Simulation definiert) des zu erwerbenden Add-Ons.

includeReceipt
Boolean

bool

Bestimmt, ob die Methode die Belege für die angegebene productId zurückgeben soll.

Gibt zurück

IAsyncOperation<String>

IAsyncOperation<Platform::String>

IAsyncOperation<winrt::hstring>

Eine Zeichenfolge, die In-App-Produktkaufdetails für die bereitgestellte productId bereitstellt. Wenn includeReceipttrue festgelegt ist, enthält die zurückgegebene Zeichenfolge eine vollständige Empfangs-XML.

Attribute

Hinweise

Die Hinweise für RequestProductPurchaseAsync(String) gelten auch für diese Überladung.

Um zu überprüfen, ob die Produktlizenz nach einem erfolgreichen Aufruf dieser Überladung aktiv ist, verwenden Sie die LicenseInformation.IsActive-Eigenschaft .

Ein Beispiel für die Verwendung dieser Methode finden Sie in unserem Codebeispiel.

Weitere Informationen

Gilt für:

RequestProductPurchaseAsync(String, String, ProductPurchaseDisplayProperties)

Erstellt den asynchronen Vorgang, der die Benutzeroberfläche anzeigt, die zum Simulieren des Kaufs eines Add-Ons (auch als In-App-Produkt oder IAP bezeichnet) aus dem Microsoft Store verwendet wird. Diese Überladung umfasst Parameter, die Sie verwenden können, um Details für ein bestimmtes Angebot in einem großen Katalog von In-App-Käufen anzuzeigen, der durch einen einzelnen Produkteintrag im Store dargestellt wird.

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)

Parameter

productId
String

Platform::String

winrt::hstring

Die Produkt-ID (wie in der Simulation definiert) des zu erwerbenden Add-Ons.

offerId
String

Platform::String

winrt::hstring

Das spezifische In-App-Produkt innerhalb des großen Einkaufskatalogs, der im Microsoft Store durch die productId dargestellt wird. Dieser Wert korreliert mit dem Inhalt, für den Ihre App verantwortlich ist. Der Microsoft Store verwendet diesen Parameterwert nur zum Auflisten der PurchaseResults.

displayProperties
ProductPurchaseDisplayProperties

Der Name des In-App-Produkts, das dem Benutzer zum Zeitpunkt des Kaufs angezeigt wird.

Gibt zurück

Ein PurchaseResults-Objekt , das die Ergebnisse der simulierten In-App-Produktkaufanforderung enthält.

Attribute

Hinweise

Die Hinweise für RequestProductPurchaseAsync(String) gelten auch für diese Überladung.

Weitere Informationen

Gilt für: