Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to consume a purchased item with In-App Purchase on iOS?

I had an app written on Android using In-App Billing(IAB), now I'm thinking of porting it to iOS.

Android's IAB has a concept of "consuming", as all purchased items are maintained by Google Play, not in the app:

In Version 3, all in-app products are managed. This means that the user's ownership of all in-app item purchases is maintained by Google Play, and your application can query the user's purchase information when needed. When the user successfully purchases an in-app product, that purchase is recorded in Google Play. Once an in-app product is purchased, it is considered to be "owned". In-app products in the "owned" state cannot be purchased from Google Play. You must send a consumption request for the "owned" in-app product before Google Play makes it available for purchase again. Consuming the in-app product reverts it to the "unowned" state, and discards the previous purchase data.

I went through the document of iOS In-App Purchase but didn't find similar ones. So how do we "consume" a purchased product on iOS?

like image 571
Deqing Avatar asked Mar 24 '14 01:03

Deqing


1 Answers

On iOS you are responsible for tracking the inventory of consumable items. You can do so with a local file store or you can use a server-based storage system. The latter is preferred, since it will allow you to track the user's inventory across multiple devices and restore their inventory if they delete and re-install your app, although this is not required by Apple's policies. From the In-App Purchase Guidelines

Consumable items are the one exception to the requirement that your content be available on all the user’s devices. Consumable items are digital items that are used up or disappear after use and can never be reused. Examples of consumable items include virtual poker chips, in-game ammunition, or virtual supplies such as construction materials.

like image 79
Paulw11 Avatar answered Nov 16 '22 01:11

Paulw11