共用方式為


StoreContext.GetCustomerPurchaseIdAsync(String, String) 方法

定義

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

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

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

傳回

IAsyncOperation<String>

IAsyncOperation<Platform::String>

IAsyncOperation<winrt::hstring>

在成功完成時,非同步作業會傳回目前使用者的購買識別碼金鑰。 此金鑰有效期限為 30 天。

屬性

備註

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

適用於

另請參閱