CurrentApp.GetCustomerPurchaseIdAsync(String, String) 方法

定义

检索 Microsoft Store ID 密钥,该密钥可用于代表当前用户授予免费产品的权利。

public:
 static IAsyncOperation<Platform::String ^> ^ GetCustomerPurchaseIdAsync(Platform::String ^ serviceTicket, Platform::String ^ publisherUserId);
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<winrt::hstring> GetCustomerPurchaseIdAsync(winrt::hstring const& serviceTicket, winrt::hstring const& publisherUserId);
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<string> GetCustomerPurchaseIdAsync(string serviceTicket, string publisherUserId);
function getCustomerPurchaseIdAsync(serviceTicket, publisherUserId)
Public Shared Function GetCustomerPurchaseIdAsync (serviceTicket As String, publisherUserId As String) As IAsyncOperation(Of String)

参数

serviceTicket
String

Platform::String

winrt::hstring

标识当前应用的发布者的 Azure Active Directory 访问令牌。 有关生成此令牌的详细信息,请参阅 从服务管理产品权利

publisherUserId
String

Platform::String

winrt::hstring

一个匿名 ID,用于标识你作为当前应用的发布者管理的服务上下文中的当前用户。 如果在服务上下文中维护用户 ID,则可以使用此参数将当前用户的 ID 与新的 Microsoft Store ID 密钥相关联, (用户 ID 将嵌入到密钥) 中。 否则,如果不需要将用户 ID 与 Microsoft Store ID 密钥相关联,则可以传递任何字符串值。

返回

IAsyncOperation<String>

IAsyncOperation<Platform::String>

IAsyncOperation<winrt::hstring>

当前用户的购买 ID 密钥。 此密钥的有效期为 30 天。

属性

Windows 要求

设备系列
Windows 10 (在 10.0.10586.0 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v2.0 中引入)

注解

具有应用内购买目录的发布者可以在对 Microsoft Store 购买 API 的服务到服务调用中使用 Microsoft Store ID 密钥,代表当前用户授予免费产品的权利。 权利表示客户有权使用通过 Microsoft Store 发布的应用或应用内产品 (IAP) 。 有关详细信息,请参阅管理来自服务的产品授权

适用于

另请参阅