void OpenOpenChannelList() { openChannelListPanel.SetActive(true); foreach (UnityEngine.Object btnChannel in btnChannels) { GameObject.Destroy(btnChannel); } btnChannels.Clear(); mChannelListQuery = OpenChannel.CreateOpenChannelListQuery(); mChannelListQuery.Limit = 50; LoadOpenChannels(); }
private void GetChannelFromList(string channelMetadata, Action <OpenChannel, SendBirdException> resultHandler) { OpenChannelListQuery query = OpenChannel.CreateOpenChannelListQuery(); query.Next((channels, e) => { if (e != null) { Debug.LogError(e); resultHandler?.Invoke(null, e); return; } var channel = channels.Find(c => c.Data == channelMetadata); resultHandler?.Invoke(channel, e); }); }
public void GetListOpenGroup() { string s = ""; OpenChannelListQuery mChannelListQuery = OpenChannel.CreateOpenChannelListQuery(); mChannelListQuery.Next((List <OpenChannel> channels, SendBirdException e) => { if (e != null) { // Error. return; } Debug.Log(channels[0].Url); EnterChannel(channels[0].Url); }); }
private async Task <List <OpenChannel> > GetChannels(string channelName = null) { var tcs = new TaskCompletionSource <SendBirdException>(); var result = new List <OpenChannel>(); var channelListQuery = OpenChannel.CreateOpenChannelListQuery(); channelListQuery.NameKeyword = channelName; channelListQuery.Next((channels, ex) => { result = channels; tcs.SetResult(ex); }); HandleException(await tcs.Task); return(result); }