question

amninov avatar image
amninov asked

Need to get a V2 Virtual Currency balance per each Friend from the GetFriendsList

The only option I see is to call the Economy API "/inventory/GetInventoryItems" per friend. At the same time this call requires friend's EntityToken. So, I have to use friend's login or getEntityToken to call the GetInventoryItems. Complicated...

Is there is a better way to do it? It looks like the PlayerProfileViewConstraints does not have such option. Maybe there is a way to use ShowValuesToDate and somehow keep current balance there.

In-Game EconomyFriends
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

·
Xiao Zha avatar image
Xiao Zha answered

Currently PlayFab doesn’t support to get friend’s currency balance along with the GetFriendsList API.

The option you mentioned to call the Economy API GetInventoryItems per friend to get friend’s currency balance is a workable way, you could pass the Friend Info list into Azure Function, then call Get Title Players From Master Player Account Ids API with PlayFab ID in Friend Info list to get Title Player Account Entity in Azure Function, then call Get Inventory Items API with Title Player Account Entity in Azure Function, and then return a list of currency balance of friends. In this case, you don’t have to use friend's login or GetEntityToken API to get friend’s entity token to call GetInventoryItems.(We don’t recommend to getting other player’s Entity Token and Title Entity Token on client).

In addition, the ShowValueToDate means the player's lifetime purchase totals, summed by real-money currency, it’s a part of Economy V1 and cannot be used to store currency balance.

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.