question

ilyas avatar image
ilyas asked

Get incoming trades

Hi, I want to implement send lives system using trading. I read old threads about this but still asking here for clarity. I created trade request as following. friendsIDs is array of friend playfabIDs that i am asking for life.

            OpenTradeRequest request = new OpenTradeRequest();
            request.AllowedPlayerIds = friendsIDs;
            request.RequestedCatalogItemIds = new List<string>() { "Life" };

            PlayFabClientAPI.OpenTrade(request, OnSuccess, OnError);

            void OnSuccess(OpenTradeResponse response)
            {
                Debug.Log("PF : Life request sent");
            }

            void OnError(PlayFabError error)
            {
                Debug.Log(error.GenerateErrorReport());
            }

Now what ? How to notify other friends about trade. Is there a way to list incoming trades ?

Trading
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

·
Sarah Zhang avatar image
Sarah Zhang answered

>> How to notify other friends about trade. Is there a way to list incoming trades ?

There is no corresponding API can list incoming trades. As this documentation Trading said, Inventory-trading functionality is in a preview phase. The methods are functional, but lack some useful elements that would make it a complete feature. Currently, PlayFab does not provide a list of trades that are available to you from other players. Players can only accept the specific trade which possesses known OfferingPlayerId, TradeId.

Besides, PlayFab provides a separate Notification feature independent of Trading, you can combine them to achieve the trades notification function on your own. Currently, PlayFab Notification pushing only supports Android and iOS, please check the documentation Push notifications tutorials for more details. If you want to push notifications in the game or on other platforms, please search for the corresponding external service for it, such as Azure Notification Hubs, Azure Service Bus, etc.

2 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.

ilyas avatar image ilyas commented ·

Thanks for information i will look another ways to achieve this. Can you change title as "Get incoming trades" etc. Retention difference is misleading

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan ilyas commented ·

Hi @ilyas, we changed the title as you asked:)

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.