Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to restore a Consumable In app Purchases?

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?

like image 919
Olga Avatar asked Jul 04 '11 09:07

Olga


2 Answers

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.

like image 119
Lio Avatar answered Sep 19 '22 08:09

Lio


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.

like image 28
Perception Avatar answered Sep 18 '22 08:09

Perception