StoreContext.ReportConsumableFulfillmentAsync(String, UInt32, Guid) 方法

定義

報告目前應用程式的消費性附加元件,如 Microsoft Store 中所完成。

public:
 virtual IAsyncOperation<StoreConsumableResult ^> ^ ReportConsumableFulfillmentAsync(Platform::String ^ productStoreId, unsigned int quantity, Platform::Guid trackingId) = ReportConsumableFulfillmentAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<StoreConsumableResult> ReportConsumableFulfillmentAsync(winrt::hstring const& productStoreId, uint32_t const& quantity, winrt::guid const& trackingId);
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<StoreConsumableResult> ReportConsumableFulfillmentAsync(string productStoreId, uint quantity, Guid trackingId);
function reportConsumableFulfillmentAsync(productStoreId, quantity, trackingId)
Public Function ReportConsumableFulfillmentAsync (productStoreId As String, quantity As UInteger, trackingId As Guid) As IAsyncOperation(Of StoreConsumableResult)

參數

productStoreId
String

Platform::String

winrt::hstring

您想要回報為已完成之消費性附加元件的市集識別碼。

quantity
UInt32

unsigned int

uint32_t

您想要回報為已完成的消費性附加元件單位數目。 若為市集管理的消費性 (,Microsoft 會追蹤) 餘額的消費性產品,請指定已取用的單位數。 針對開發人員管理的消費性 (,也就是開發人員追蹤餘額的消費性) ,請指定 1。

trackingId
Guid

Platform::Guid

winrt::guid

開發人員提供的 GUID ,可識別履行作業為了追蹤目的而相關聯的特定交易。 如需詳細資訊,請參閱備註。

傳回

在成功完成時,非同步作業會傳回 StoreConsumableResult 物件,其中包含履行作業的相關資訊,例如附加元件單位的剩餘餘額。

屬性

備註

使用者在您的應用程式中使用消費性附加元件之後,請使用這個方法將附加元件回報為 Microsoft Store 中已完成的附加元件。 附加元件的市集識別碼可在合作夥伴中心取得,並由代表附加元件的StoreProduct 的 StoreId屬性傳回。 如需使用此方法的詳細資訊,包括程式碼範例,請參閱 啟用消費性附加元件購買

trackingId參數可用來協助確保 Microsoft Store 只處理每個履行作業一次。 例如,假設您呼叫 ReportConsumableFulfillmentAsync 且具有一對 productStoreIdtrackingId 值,Microsoft Store 已成功將消費性產品標示為已完成,但有網路連線問題可防止您的應用程式接收及處理回應。 下次您的應用程式在重新取得連線能力之後,使用相同的 productStoreIdtrackingId 值對的 ReportConsumableFulfillmentAsync 呼叫時,Microsoft Store 會將交易回報為成功,而不會再次向使用者收費。 trackingId參數可以透過StoreConsumableResult傳回值的TrackingId屬性來擷取。

適用於

另請參閱