question

doronhn avatar image
doronhn asked

GetFriendLeaderboard allwase return 0

Hey,

when i am calling PlayFabClientAPI.GetFriendLeaderboard i am alwase get 0 result.

request:GetFriendLeaderboardRequest getFriendLeaderboardRequest = new GetFriendLeaderboardRequest()

        {
            MaxResultsCount = 5,
            StatisticName = $"lEVEL_STATISTICS_NAME",
            ProfileConstraints = ProfileConstraints
        };


PlayFabClientAPI.GetFriendLeaderboard(getFriendLeaderboardRequest, (result) =>
        {

            Debug.Log(result.Leaderboard.Count());

        }, (error) =>
        {
            Debug.LogError(error);
        });

i am trying to call the API when i am logged in when this PlabfabID = "4720617DB4FEF450" , and he has friends:

what do i do wrong?

all the other request working (get leaderboard).

apisLeaderboards and Statistics
friends.png (24.8 KiB)
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

We tested this API in our testing title, this API works fine. Could you please confirm whether these two friends have data under the corresponding leaderboard? If there are no these two rankings in the targeted leaderboard, the Leaderboard field in the response of GetFriendLeaderboard would be an empty array. You can navigate to these two player’s [Statistic] page to check their Statistics info.

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

doronhn avatar image doronhn commented ·

Hey,

1. this players return when i call GetLeaderboard. so they have stats.

2. both of them had statistics as you can see:

0 Likes 0 ·
friends1.png (48.3 KiB)
Sarah Zhang avatar image Sarah Zhang doronhn commented ·

Could you please provide your TitleID?

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

TitleID: 1660

0 Likes 0 ·
Show more comments
Sarah Zhang avatar image Sarah Zhang doronhn commented ·

Apologies for the delayed reply. We tried to create a testing account in your title, add these two players as friends, then call the GetFriendLeaderboard API. It can work fine.

Could you please check whether you use the correct statistic name in the request body? This is our testing request body.

{
  "StatisticName": "Levels"
}
0 Likes 0 ·
doronhn avatar image doronhn Sarah Zhang commented ·

Yes, i have double check again.

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.

Error rendering WebPanel (widgets/consolidation-widget.ftl): org.hibernate.hql.internal.ast.QuerySyntaxException: AvailableConsolidation is not mapped [from AvailableConsolidation up where up.node = :node]