question

Joe Hopkins avatar image
Joe Hopkins asked

When will "Get Profiles" be available in the PlayFab Unity Plugin

We are calling PlayFabGroupsAPI.ListGroupMembers to get the ID's of all the players in a group. But this call only returns their title ID. What API request can we send these ID's to in order to have more profile information (such as DisplayName)?

It appears that Get Profiles might work, but it does not appear as an option in the PlayFab Unity SDK.

Player Data
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Made Wang avatar image
Made Wang answered

Sorry for the wrong answer. Currently, DisplayName in GetProfile is not working, please try to use GetPlayerProfile and GetPlayerCombinedInfo mentioned above.

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.

Joe Hopkins avatar image Joe Hopkins commented ·

We can't do this because we need to get multiple profiles. GetPlayerProfile and GetPlayerCombinedInfo only returns records for 1 player. When will the bug be fixed?

0 Likes 0 ·
Made Wang avatar image Made Wang Joe Hopkins commented ·

I can't give a clear time, you can try to use SetObjects to store DisplayName, refer to Use entity objects to store player data - PlayFab | Microsoft Docs.

0 Likes 0 ·
Made Wang avatar image
Made Wang answered

Because you already have IDs, if you want to get player detailed information, you can try to call GetPlayerProfile or GetPlayerCombinedInfo.

Regarding GetProfiles, if you want to call it, you need to add a reference to PlayFab.ProfilesModels and pass the entity when calling it.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Joe Hopkins avatar image Joe Hopkins commented ·

Thank you, we were able to implement GetProfiles, but it is not working correctly. See Answer (code did not fit in comment).

1 Like 1 ·
Joe Hopkins avatar image
Joe Hopkins answered

Thank you. GetProfiles is only returning 1 profile and all fields are blank. What are we doing wrong here?

	public void ListGroupMembers(EntityKey entityKey)
	{
		var request = new ListGroupMembersRequest { Group = entityKey };
		PlayFabGroupsAPI.ListGroupMembers(request, OnListGroupMembers, OnSharedError);
	}


	private void OnListGroupMembers(ListGroupMembersResponse response)
	{
		List<PlayFab.ProfilesModels.EntityKey> entityKeys = new List<PlayFab.ProfilesModels.EntityKey>();


		foreach (EntityMemberRole role in response.Members)
		{
			foreach (EntityWithLineage m in role.Members)
			{
				entityKeys.Add(new PlayFab.ProfilesModels.EntityKey { Id = m.Key.Id, Type = "title_player_account" });


			}


		}
		this.GetProfiles(entityKeys);


	}




	public void GetProfiles(List<PlayFab.ProfilesModels.EntityKey> entityKeys)
	{
		PlayFab.ProfilesModels.GetEntityProfilesRequest request = new GetEntityProfilesRequest { Entities = entityKeys };


		PlayFabProfilesAPI.GetProfiles(request, GetProfilesResult, GetProfilesError);
	}




	public void GetProfilesResult(GetEntityProfilesResponse response)
	{
		foreach (EntityProfileBody profileBody in response.Profiles)
		{
			Debug.Log("profileBody.DisplayName " + profileBody.DisplayName);//Only one profile is being returned and DisplayName is null
		}


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