2

I am using RN v0.46.4 and sendbird v3.0.35

I am trying to make a channel but getting the error:

Connection should be made first error code : 800101

_chat(item){

  console.log(item);

  var userIds = [1, item.id];
  sb = new SendBird({appId: APP_ID});
    sb.connect(item.id, function(user, error) {
          console.log(user);

        })

sb.GroupChannel.createChannelWithUserIds(userIds, true, item.firstname, function(createdChannel, error) {
    if (error) {
        console.error(error);
        return;
    }

    console.log(createdChannel);
});
}
YaSh Chaudhary
  • 2,605
  • 8
  • 37
  • 74

1 Answers1

1

You should call createChannel within connect function's callback so we can make sure that connect() has succeeded.

Jin Ku
  • 196
  • 1
  • 2