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

要报告为已完成的易耗品加载项的应用商店 ID。

quantity
UInt32

unsigned int

uint32_t

要报告为已完成的易耗品加载项的单位数。 对于 Microsoft 跟踪余额) 的 Microsoft 管理的易耗品 (指定已消耗的单位数。 对于开发人员管理的易耗品 (即开发人员跟踪余额) 的易耗品,请指定 1。

trackingId
Guid

Platform::Guid

winrt::guid

开发人员提供的 GUID ,用于标识与履行操作关联的特定事务以进行跟踪。 有关详细信息,请参阅备注。

返回

异步操作在成功完成时返回一个 StoreConsumableResult 对象,该对象包含有关履行操作的信息,例如加载项单位的剩余余额。

属性

注解

用户在你的应用中使用易耗型加载项后,使用此方法将加载项报告为在 Microsoft Store 中完成的。 加载项的应用商店 ID 在合作伙伴中心可用,它由表示加载项的 StoreProductStoreId 属性返回。 有关使用此方法(包括代码示例)的详细信息,请参阅 启用易耗型加载项购买

trackingId 参数用于帮助确保 Microsoft Store 只处理一次每个履行操作。 例如,假设你使用给定 的 productStoreIdtrackingId 值对调用 ReportConsumableFulfillmentAsync,Microsoft Store 成功将易耗品标记为已完成,但存在网络连接问题,导致应用无法接收和处理响应。 下次你的应用在重新获得连接后,使用同一对 productStoreIdtrackingId 值重试相同的 ReportConsumableFulfillmentAsync 调用时,Microsoft Store 将报告事务成功,而不会再次向用户收费。 可以通过 StoreConsumableResult 返回值的 TrackingId 属性检索 trackingId 参数。

适用于

另请参阅