I am trying to call GetFriendsList in the Unity SDK. I set ShowAvatarUrl to true in ProfileConstraints of GetFriendsListRequest, but it still returns null. DisplayName works fine. Here is a sample of my code -
GetFriendsListRequest request = new GetFriendsListRequest();
request.ProfileConstraints = new PlayerProfileViewConstraints();
request.ProfileConstraints.ShowAvatarUrl = true;
PlayFab.PlayFabClientAPI.GetFriendsList(request, (GetFriendsListResult result) =>
{
if (result.Friends == null)
Debug.LogError("Retrieved null friends");
else
{
foreach (PlayFab.ClientModels.FriendInfo friend in result.Friends)
{
Debug.Log($"Friend: {friend.Profile.DisplayName} - tag {friend.Tags?[0] ?? ""} - AvatarUrl = {friend.Profile.AvatarUrl}");
}
}
}, (PlayFab.PlayFabError error) =>
{
Debug.LogError(error.ErrorMessage);
});
,I am trying to retrieve friends list, and in the response friend.Profile.AvatarUrl is always null even after setting ProfileConstraints.ShowAvatarUrl to true. Here is my sample code for the request -
GetFriendsListRequest request = new GetFriendsListRequest();
request.ProfileConstraints = new PlayerProfileViewConstraints();
request.ProfileConstraints.ShowAvatarUrl = true;
PlayFab.PlayFabClientAPI.GetFriendsList(request, (GetFriendsListResult result) =>
{
if (result.Friends == null)
Debug.LogError("Retrieved null friends");
else
{
foreach (PlayFab.ClientModels.FriendInfo friend in result.Friends)
{
Debug.Log($"Friend: {friend.Profile.DisplayName} - tag {friend.Tags?[0] ?? ""} - AvatarUrl = {friend.Profile.AvatarUrl}");
}
}
}, (PlayFab.PlayFabError error) =>
{
Debug.LogError(error.ErrorMessage);
});