Share via


CurrentApp.GetCustomerPurchaseIdAsync(String, String) 方法

定義

擷取 Microsoft Store 識別碼金鑰,可用來代表目前使用者授與免費產品的權利。

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

匿名識別碼,識別您管理為目前應用程式發行者之服務內容中的目前使用者。 如果您在服務的內容中維護使用者識別碼,您可以使用此參數,將目前使用者的識別碼與新的 Microsoft Store 識別碼金鑰產生關聯, (使用者識別碼將會內嵌在金鑰) 中。 否則,如果您不需要建立使用者識別碼與 Microsoft Store 識別碼金鑰的關聯,您可以傳遞任何字串值。

傳回

IAsyncOperation<String>

IAsyncOperation<Platform::String>

IAsyncOperation<winrt::hstring>

目前使用者的購買識別碼金鑰。 此金鑰有效期限為 30 天。

屬性

Windows 需求

裝置系列
Windows 10 (已於 10.0.10586.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v2.0 引進)

備註

具有應用程式內購買目錄的發行者可以使用服務對 Microsoft Store 購買 API 的服務對服務呼叫中的 Microsoft Store 識別碼金鑰,代表目前使用者授與免費產品的權利。 權利代表客戶使用應用程式或應用程式內產品的權利, (透過 Microsoft Store 發佈的 IAP) 。 如需詳細資訊,請查看管理服務的產品權利

適用於

另請參閱