How do games store info about in-app-consumable-item?

  1. So, in case of google play, google provide 2 sort of item, non-consumable, consumable, non-consumable item(e.g. premium unlock) is stored to google server and game can restore that user’s history by checking google inventory, right?

  2. But about consumable items, how games deal this problem? game should have own game server to store user’s google play (or ios) account, date, item bought, item numbers?

If this is true,

2-1. How game know user’s identity if this user is rightful user who purchased before? (is there a checking unity function to know this user’s google play ID(or Apple ID)?)

2-2. Is there a solution about this sort of server? or game should have own server programmer and make own mysql database?

2-3. How to make this sort of database & server program? Or just need to make mysql database only? Then with only web-hosting is enough? or need server hosting for customize server?

2-4. Are there other way about this problem? not to use server?

Thanks.

I think you may be over thinking this.
I believe the difference on Googles end, is that they know a consumable can be purchased more than once.

That’s it.

A non consumable, once purchase, is yours forever. And you can not purchase it again.

As far as knowing, when a product is used up, Google does not monitor that. That is done on your end.

But how about user delete game and re-install it? Then playerprefs data also deleted and user’s purchased consumable items also deleted in his phone.

And what if user migrate to new phone? then download same game at his new phone? Then his past purchased item also should be restored.

Isn’t it?

Player prefs data is not deleted when you delete the app (to my knowledge).

As far as migration, that may be a different story. While Google will know you have purchased x item, your new phone will not. There is a general function of Restore Purchases. This may do it in case of phone swap.

Also, there are new cloud services. I imagine of you can use a cloud service in your game, to store Player Prefs, this would Allie site the phone swap and delete (if delete rids playerPrefs, which it don’t think it does) issues.

Thx for reply.
PP being deleted when delete game.

For migrate phone issue, as far as I know, google only knows and stores non-consumable purchase history. (managed item)
So this means game developers should take care about unmanaged item (consumable item).

Cloud services? Can you let me know info link about this?

It’s a Google Cloud Messaging. So, might not be what you are looking for.

yes, anyway thx.

I hope I am wrong because I don’t want to make my game’s server and mysql database for store and restore paid item…

But if true, this should be done…maybe?

I think you are talk g about such rare instances that you should no concern yourself too much with it. Having said that, I am just about to ask the guy who does my plug ins about swapping phones and IAP.