I'm trying to get AvatarUrl from the player but I do not get the url in unity. What can be happening?
I'm trying to get AvatarUrl from the player but I do not get the url in unity. What can be happening?
Can you provide more details on your use case? What specific API call are you making, where you are expecting to get the AvatarUrl? What is the Title ID in question and what PlayFab ID are you using for the test?
Sorry, I do not know how to work with playfab, and I'm not speak in English, So I made a video showing the problem:
https://youtu.be/64HhWBjwfZ8
The items in the profile only show up if you specifically request them. So, with these parameters as input to Server/GetLeaderboard in your title:
{
"StatisticName": "Score",
"MaxResultsCount": 20,
"ProfileConstraints": {"ShowAvatarUrl": true} }
I get this result, which includes the AvatarUrl:
{ "code": 200, "status": "OK", "data": { "Leaderboard": [ { "PlayFabId": "4B5B59CD339F766C", "StatValue": 4, "Position": 0, "Profile": { "PublisherId": "308E2380E164C216", "TitleId": "51D1", "PlayerId": "4B5B59CD339F766C", "AvatarUrl": "https://www.gravatar.com/avatar/205e460b479e2e5b48aec07710c08d50" } } ], "Version": 2 } }
I solved my problem by looking here:
https://community.playfab.com/questions/10446/values-showavatarurl-missing-in-the-web-model-play.html
My code in C# with the fix:
thank you Brendan.
private void GettingProfileInfo() { //Getting Playfab ID PlayFabClientAPI.GetAccountInfo(new GetAccountInfoRequest(), result => { _userId = result.AccountInfo.PlayFabId.ToString(); Debug.Log("Your Profile Playfab Id Got : " + result.AccountInfo.PlayFabId); }, error => Debug.Log("Failed To Get Playfab Id")); //Getting DisplayName and Avatar Link PlayFabClientAPI.GetPlayerProfile(new GetPlayerProfileRequest() { PlayFabId = _userId, ProfileConstraints = new PlayerProfileViewConstraints() { ShowDisplayName = true, ShowAvatarUrl = true } }, result => { _playerName = result.PlayerProfile.DisplayName; _avtarUrl = result.PlayerProfile.AvatarUrl.ToString(); Debug.Log("DisplayName is : " + result.PlayerProfile.DisplayName + "\n" + "Avatar Url is : " + result.PlayerProfile.AvatarUrl); gettingPlayerStatistics(); }, error => Debug.Log("Failed To Get Playfab Id")); }
2 People are following this question.