IAP purchasetable

Hi @adent42 @Armelline ,


I was wondering, after a success purchase, when is the purchasetable getting reset ?

Is it only when a new "request purchase data" is being made or every time the user starts a new game?


Basically I'm trying to figure out if the purchasetable acts like it's being saved after a purchase is made even due we don't use the "save table" behavior.

Thanks

Comments

  • ArmellineArmelline Member, PRO Posts: 5,353

    If you're talking about consumables, the "purchased" flag in the 5th column of the table is only reset when you trigger a "Consume" behaviour.

    If you're talking about non-consumables, it'll only be reset when the user starts a new game.

    Any purchase made will effectively "save" the table.

    Think of it like an external table that only gets loaded when you trigger "Request Purchase Data" and only gets saved when a purchase takes place.

  • solnikasolnika Member Posts: 132

    Thanks for the answer @Armelline


    I'm still a little confused, I'm talking about non-consumables.

    You are saying that it will reset every time a user starts a new game or only when I trigger "Request Purchase Data" after the user start a new game?


    Lets say a user start a game and made a purchase, now he close the game and a day later reopen the game, will the "purchasetable" show purchase on that item or will it be empty ?

  • ArmellineArmelline Member, PRO Posts: 5,353

    When you "Request Purchase Data" it will replace the current contents of the table with the info received from Apple/Google. You should not rely on the PurchaseTable to track if a player has made a purchase.

    When you see the purchase successfully complete, change an attribute or table cell in another table to record this, and save that. The PurchaseTable is not intended for you to be editing or saving it.

    I'm not actually sure what happens if you trigger a Save Table Value on it—I've never actually tried. I assume though it gets loaded as blank each time the player opens the app. It doesn't matter, though —you should only be looking at that table when the player is engaged in making a purchase and it will get overwritten when Request Purchase Data is triggered.

    Keep a separate record of successful purchases.

  • solnikasolnika Member Posts: 132

    Ok that make sense, thanks for the answer.

Sign In or Register to comment.