hOOks7
hOOks7

Reputation: 71

Restoring "remove ads" functionality when using consumable IAP

I'm researching how to properly implement the functionality to remove ads in my app when the user makes any IAP and have that functionality restorable.

The way i'm seeing the first part done is to simply put a value in the user defaults that the user has made a purchase and check it before displaying ad. No problem.

But i don't know how to do the restorable part because all my products are consumables. How can I restore this value when the user reinstalls the app? Because as i understand the only record of a consumable is on the device and cannot be restored by apple correct?

Any help would be greatly appreciated, thanks!

Upvotes: 0

Views: 1089

Answers (1)

Paulw11
Paulw11

Reputation: 114846

You cannot do this purely through store-kit APIs, as there is no restorable purchase record as you say. I can see a couple of options -

  1. You could enable iCloud for your app and persist data to the user's iCloud account, however this won't work for users who don't have iCloud.
  2. You could have the users register an account on your server and use that to store their purchase history (or provide a Facebook login etc).
  3. If a user deletes and re-installs your app then they need to make another in-app purchase to remove the ads - Profit!

Upvotes: 2

Related Questions