question

Andrew avatar image
Andrew asked

PurchaseItemResult DisplayName not updated

I'm using Unity and PlayFabClientAPI.PurchaseItem() to purchase items on a client with VC.

This all works fine, however I noticed that when I changed the "Display Name" in the Catalog through Game Manager, this change is not updated in the DisplayName given by PurchaseItemResult.

Similarly, the DisplayName is not updated in GetUserInventoryResult (even when the item is acquired after the DisplayName has already been changed).

GetCatalogItemsResult however does return the latest DisplayNames for items. It has been more than 24 hours since I made the change.

So the workaround I'm using at the moment is getting the itemID and then looking it up in the catalogue from GetCatalogItemsResult to get the latest DisplayName (which is correct).

For example, I renamed "Clay" to "Clay X". GetUserInventoryResult and PurchaseItemResult both give the DisplayName of "Clay". GetCatalogItemsResult returns the newly updated name of "Clay X".

TitleID to look at this for is E9E15

I would expect that the DisplayName on PurchaseItemResult and GetUserInventoryResult would give the latest DisplayName (after caches/shards are updated).

1 comment
10 |1200

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

Andrew avatar image Andrew commented ·

Forgot to add, I'm purchasing a Bundle which gives an item from a Drop Table.

I tried creating a new bundle and new drop table, and I get the same old data (e.g. I still get "Clay" instead of "Clay X" in the DisplayName from PurchaseItemResult).

0 Likes 0 ·

1 Answer

·
Sarah Zhang avatar image
Sarah Zhang answered

We’ve checked your Title, and reproduced this situation. We found that your items are stackable. It means when you call the PurchaseItem only the RemainingUses(Item’s remaining count) would be added. Other information like purchase date and display name will not be changed. It should be a mechanism designed to prevent anyone from changing the stackable items’ display names. If the item is not stackable, purchase date and display name will be updated.

If you want to debug your code and settings more conveniently, we suggest you to use Postman. Check the doc to learn how to use it. You can call APIs via Postman to check the complete result quickly.

3 comments
10 |1200

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

Andrew avatar image Andrew commented ·

Thanks for the explanation. That makes sense, however is this still expected behavior even when the player has 0 of an item and makes a purchase? For example, if they have 0 "Clay X" and they buy the itemID that corresponds with it, it will still come up as "Clay". Is the old name forever tied to their account regardless of RemainingUses?

A new player who has never purchased the item will receive "Clay X" (the new name).

How do you suggest that a game update the Display Name of items for old players?

0 Likes 0 ·
Sarah Zhang avatar image Sarah Zhang Andrew commented ·

As the above said, you can’t update stackable items’ display names directly. Maybe you can change the design to simplify your operations. Use unstackable items(uncheck Is stackable that is in the Edit Item Page), and stack them manually via the Unity Script. If the item is unstackable, its display name can be updated.

If it’s necessary to update them for old players, you can store the new display name data with Key/Value pairs via the CustomData instead of DisplayName. You can update it via server API or Game Manager. Custom data can be updated when you do the purchase or GetUserInventory. If you can’t change the scripts of clients. Please use server APIs to replace your old items stack to new ones. Use RevokeInventoryItem to revoke items that have old display names, and use GrantItemsToUser to grant items that have the same counts and new display names. You can use Server APIs via the CloudScript.

0 Likes 0 ·
Andrew avatar image Andrew Sarah Zhang commented ·

Thanks for the suggestions! I might look into revoking and regranting new items if needed.

0 Likes 0 ·

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.