应用内购买,消耗品

In-app purchase, consumable

这是一个 Cocoa 应用内购买问题。

我有一款游戏,您可以在其中购买 10 条生命,这是 消耗品 应用内购买——一旦生命用完,用户必须买更多。

如果用户使用了生命的一个子集,比如 5,然后删除应用程序、重新安装并恢复购买,会发生什么情况? Apple 会告诉用户他们购买了一套 10 条生命,我的程序会很乐意为他们提供额外的 5 条生命。

我的服务器需要跟踪这些数据吗?我没有在应用内购买文档中找到有关如何进行此操作的任何信息。

如果用户使用了生命的一个子集,比如 5 个,然后删除应用程序,重新安装并恢复购买,会发生什么情况?Apple 会告诉用户他们购买了 10 个一组生命,我的程序将很乐意为他们提供 5 条额外的生命。

不!消耗品无法恢复。即使您提供恢复 IAP,消耗品也无法恢复。因此,您担心用户将获得 5 条额外生命是毫无根据的,但是是的,如果您的应用正在与服务器同步数据,您需要跟踪用户使用的生命。

Apple 文档是这样说的,

https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Chapters/Products.html#//apple_ref/doc/uid/TP40008267-CH2-SW2

Consumable products, by their nature, aren’t synced or restored. Users understand that, for example, buying ten more bubbles on their iPhone doesn’t also give them ten more bubbles on their iPad. All other types of products are made available across all of the user’s devices. They’re also restored so users can continue to access their purchased content even after buying a new device. Store Kit handles the syncing and restoring process for auto-renewable and free subscriptions and for non-consumable products.

Products that expire or get used up—consumable products, auto-renewable subscriptions, and non-renewing subscriptions—can be purchased multiple times to get the consumable item again or extend the subscription.