question

Ozan Yilmaz avatar image
Ozan Yilmaz asked

Is there any way to update user read only data when purchase is confirmed?

Hello everyone,

There is a money variable in our game that is stored in the players' read only data. Since it can exceed the int32 limit, I store that data in the read only data section.

I want the players to be able to buy in-game money with real money. Is there a way to do this?

As far as I know, there's not a direct way to change read only data by purchase API so that I'm thinking of creating some stackable items. For example;
"item-10000"
"item-100000"
"item-1000000"

When one of these items is purchased, I need to execute a function in the cloudscript so that I can change the related data. If this solution feasible, is there any event that is triggered when a purchase is confirmed, and is there a way to get the purchased item's name? Because I need to check how much in-game money the player bought?

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Seth Du avatar image
Seth Du answered

Players in-app purchase will generate “player_inventory_item_added” event when ConfirmPurchase is called. You are able to create a rule to update the Player Read-Only Data.

If you have any issue on creating one. Please try to complete a transaction in sandbox mode and share your title ID with us so that we can look into the PlayStream Events in your title.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.