Skip to content

Add API for fetching channel members #122

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Assets/Talo Game Services/Talo/Runtime/APIs/ChannelsAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,5 +183,16 @@ public async Task Invite(int channelId, int playerAliasId)
var content = JsonUtility.ToJson(new ChannelsInviteRequest { inviteeAliasId = playerAliasId });
await Call(uri, "POST", content);
}

public async Task<PlayerAlias[]> GetMembers(int channelId)
{
Talo.IdentityCheck();

var uri = new Uri($"{baseUrl}/{channelId}/members");
var json = await Call(uri, "GET");

var res = JsonUtility.FromJson<ChannelsMembersResponse>(json);
return res.members;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace TaloGameServices
{
[System.Serializable]
public class ChannelsMembersResponse
{
public PlayerAlias[] members;
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.