8
votes

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?

2
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

2 Answers

5
votes

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.

4
votes

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.