【问题标题】:sendbird error - Connection should be made firstsendbird 错误 - 应首先建立连接
【发布时间】:2018-06-19 18:31:18
【问题描述】:

我正在使用 RN v0.46.4 和 sendbird v3.0.35

我正在尝试创建频道但收到错误:

应先连接错误代码: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);
});
}

【问题讨论】:

    标签: react-native react-native-android sendbird


    【解决方案1】:

    您应该在 connect 函数的回调中调用 createChannel,以便我们可以确保 connect() 已成功。

    【讨论】:

      猜你喜欢
      • 2015-01-14
      • 1970-01-01
      • 1970-01-01
      • 2018-04-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-08-28
      • 2017-08-23
      相关资源
      最近更新 更多