Search code examples
xamarinxamarin.formsxamarin.androidsendbird

How to retrieve Channel created with userIDs?


The SendBird .NET Docs mention how to create a channel with userIDs but how do we retrieve this channel?

Then the docs mention a way to retrieve a channel with a URL but they don't mention how to create a channel with a URL.

I'm a bit confused. What am I missing? Could you please let me know how to create and retrieve a channel using either userIDs or a channel URL?


Solution

  • Try this:

    public async void ConnectToChannel(FormsChat.Model.User user, List<string> users) {
        GroupChannel group = null;
        IsBusy = true;
    
        GroupChannel.CreateChannelWithUserIds(users, true, (GroupChannel groupChannel, SendBirdException e) => {
            if (e != null)
            {
                // Error.
                return;
            }
            group = groupChannel;
         });
         await Task.Delay(3000);
         IsBusy = false;
         await Navigation.PushAsync(new ChatPage(user, group));
    }
    

    Additionally, see this sample for Xamarin.Forms using SendBird