Hi,
I want to list all the groups which player is a part of.
LoginResult contains ClientAPI entitykey but ListMembershipRequest in PlayFabGroupsApi.ListMembership call require GroupsModel.EntityKey.
How should I retrieve clients groups?
Hi,
I want to list all the groups which player is a part of.
LoginResult contains ClientAPI entitykey but ListMembershipRequest in PlayFabGroupsApi.ListMembership call require GroupsModel.EntityKey.
How should I retrieve clients groups?
Since you want to list all the groups associated with the player, then the GroupsModel.EntityKey used in PlayFabGroupsApi.ListMembership method is exactly the same entity key returned in LoginResult. What you need to do here is manually wrap it into GroupsModel.EntityKey like the following:
//TitlePlayerEntityKey is the property that stores entitykey returned by LoginResult.EntityToken.Entity PlayFabGroupsAPI.ListMembership(new PlayFab.GroupsModels.ListMembershipRequest { Entity = new PlayFab.GroupsModels.EntityKey { Id = TitlePlayerEntityKey.Id, Type = TitlePlayerEntityKey.Type } }, result => { foreach (var group in result.Groups) { Debug.Log(group.Group.Type + " : " + group.Group.Id + " - " + group.GroupName); } }, error => { Debug.LogError(error.GenerateErrorReport()); });
2 People are following this question.