V
V
Vas3K2012-10-03 18:21:02
iPhone
Vas3K, 2012-10-03 18:21:02

What is the best way to store buns purchased through In-App Purchase?

For the first time I work with In-App Purchase, I have a small question. In the game application, consumable buns are planned, having a certain amount. Initially, a certain amount is available, you can spend it. Bonuses can be given out in a bunch of ways, including for the richest and laziest - to buy (the standard behavior of most games).
In what, actually, a problem. It's expensive to make your own server for storing goodies. The main screen always displays the number “you have N goodies” and I would not like to make constant requests either, you need to store it locally. But at the same time, if the user spent half of his salary on goodies, and after reinstalling the application he loses all of them, it will also not be very correct.
So far, I've done it through NSUserDefaults, so I think maybe there are some ways to do this for a long time, for example, through GameCenter, iCloud or something else that I don't know about?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
V
Vitali, 2012-10-03
@Screatch

It is better to store this information on the server. VPS, for example, are now not so expensive.

K
Krypt, 2012-10-04
@Krypt

IMHO, the server is better. Firstly, as already mentioned, they won’t break it, and secondly, if the user reinstalls the application, the given or purchased goodies will not be saved without a server.

A
Arseniy, 2012-10-04
@keyf

It depends on the popularity of the game, of course, but a simple VPS, as suggested by the author above, should be able to handle even 100 database requests per minute.
If the external server is still a no-no, then here is the result of express google: stackoverflow.com/questions/7810157/can-i-use-icloud-to-sync-the-nsuserdefaults-plist-file .
For me, for general development: are bonuses spent in the game as a result of user actions, or can there be any “external reasons”? If the first option (i.e. only locally, in the application and in response to user action), then it seems to me that the best solution would be to synchronize occasionally with a remote server, and not requests in real-time.

U
usgleb, 2012-10-07
@usgleb

Or you can not fence your bike, but simply use a ready-made backend for mobile platforms, for example www.quickblox.com . It's free and there's a great SDK for iOS. If you want, I can tell you more in PM.

P
Pilot34, 2012-10-08
@Pilot34

MKStoreKit can store data about in-apps in the keychain so that data is not lost after deletion and installation on the same device. To synchronize between devices, you need NSUbiquityStore (the same as NSUserDefaults, only via iCloud)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question