8

I'm developing an iOS game where the users can buy some amount of internal currency (say 1000 golds) by a Consumable In App Purchase.

How to restore a Consumable Purchase if the users want to transfer their balance from one device to another?

In Apple's docs it says that we have to use our own server. But how to get user's Apple IDs? Or may be there is some other way to track consumable purchases?

1
  • 1
    I think you have to store the whole data of your user at your own servers. Think of an possibility where the user can upload it's data to your server and synchronize it to another device. You don't have to use the Apple ID, just create your own unique id of the users and show him how he can synchronize his data. – AlexVogel Jul 4 '11 at 13:37
5

If what you want to do is to share the products the user buys across different devices; you will need to:

  1. Keep the game state in the server and obtain it from the device.

  2. Identify users somehow, i.e. username/pass.

  3. Update the game state in the server each time the user buys/consumes/gains products

If you only need to share state across different installs on the same device, you could just use the device ID to identify the user.

2
  • I have an app, users buy coins, and they spend their coin to buy some themes, what is the best way to restore their consumable purchases? – TomSawyer Feb 29 '16 at 13:11
  • In this case would the developer be forced to implement this restore functionality in order to not be rejected by the appstore? – pr00thmatic Jun 14 '18 at 2:44
4

You will need to be able to store the users state in a manner independent of the device they are using to access your game. So this would mean implementing a server based user profile with authentication (and appropriate security), or using some third party service.

Note that since iOS 4.1 you have the ability to use GameKit, which provides alot of these benefits for you. If you use GameKit then you will be able to retrieve user information from GKPlayer, and use this information to store currency amounts and other state in your own server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.