How can I restore consumable item. when reinstall the app?

AcroxiaAcroxia Member, PRO Posts: 51

First of all, I wrote it using a translator. Please excuse me.


I'm going to sell consumable items.

How can I restore consumable items. if the user reinstalls the app?

Comments

  • uptimistikuptimistik Key Master, Member, Sous Chef, PRO Posts: 297

    Hi there! So, consumable items are lost when the user reinstalls the app. We can, however, use the Restore Purchase behavior to restore non-consumable items e.g. if the player paid to unlock new levels, that is a non-consumable purchase and would need to be restored if the user reinstalled your game.

    You can create a button that is labeled 'Restore Purchase' and put the Restore Purchase behavior in there.

    Hope this helps!

    GameSalad Templates and Custom Development at the Official Marketplace: http://gshelper.com

  • adent42adent42 Key Master, Head Chef, Executive Chef, Member, PRO Posts: 3,159

    As @uptimistik said, consumable items are not restorable in and of themselves. Games are expected to store consumables usage information on their own servers or on Game Center. We currently don't support Game Center game storage, so you would need to have your own login to uniquely identify the user.

    Here is the expected flow:

    • User purchases consumable
    • Purchase table updates
    • Game sees update and moves consumables to another table.
    • Game acknowledges consumable via behavior
    • Prompt the users to create an account so they can keep using their consumables between installs.
    • Use the account info as part of the Send Table call to store consumables.
    • Every time a consumable is used, Send Table is called to update the consumable on the server.

    There are a lot more details to implement, but I hope that gets you started.

  • AcroxiaAcroxia Member, PRO Posts: 51

    @adent42 Where should I send the table?

    Is there a function to send a table with the game center ID?

  • ArmellineArmelline Member, PRO Posts: 5,354

    Apple are deeply inconsistent about this. I've had numerous submissions rejected over this, but numerous others accepted without issue.

    If you allow the player to buy coins or some other currency, then the player buys non-consumable items with that currency, such as race tracks or character outfits, Apple will sometimes demand that these purchased items be restorable. Sometimes they won't. That's Apple review for you.

    If you are unlucky and get a reviewer who insists on items purchased with consumable currency be restorable, there are two ways to go about it.

    1. As @adent42 says, make the player register an account and record what they purchase on your own server. When they log in on a new device etc. they can then have all their purchases restored.
    2. Have the player buy the ability to "purchase", for free, a non-consumable item. i.e. The player pays 50 coins to unlock a race track. The track gets unlocked, but so does a button that lets them trigger a non-consumable purchase. This purchase is then recorded on Apple's servers. When the player does a Restore Purchases, you can check if this purchase was made and unlock the track.

    I've had cases where I've used each (more 2 though, as few games I've done have been complex enough to warrant 1), and Apple have accepted it as a valid solution.

    As I said, though... Apple are so, so inconsistent about this. I'd say 85% of games I've submitted where this applies have been accepted without issue. So I recommend you only worry about this if Apple flag it up during review. Often they don't.

Sign In or Register to comment.