StoreContext.GetCustomerPurchaseIdAsync(String, String) 方法

定义

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

public:
 virtual IAsyncOperation<Platform::String ^> ^ GetCustomerPurchaseIdAsync(Platform::String ^ serviceTicket, Platform::String ^ publisherUserId) = GetCustomerPurchaseIdAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<winrt::hstring> GetCustomerPurchaseIdAsync(winrt::hstring const& serviceTicket, winrt::hstring const& publisherUserId);
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<string> GetCustomerPurchaseIdAsync(string serviceTicket, string publisherUserId);
function getCustomerPurchaseIdAsync(serviceTicket, publisherUserId)
Public 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 天。

属性

注解

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

适用于

另请参阅