我该如何解决这个问题:
具有唯一名称的频道已存在
以下是创建频道的代码:
tc.joinGeneralChannel = function () {
console.log('Attempting to join ' + $channelName + 'chat channel...');
if (!tc.generalChannel) {
console.log('Channel doesn\'t exists');
// If it doesn't exist, let's create it
tc.messagingClient.createChannel({
uniqueName: $channelName,
friendlyName: $channelName
}).then(function (channel) {
tc.generalChannel = channel;
tc.loadChannelList(tc.joinGeneralChannel);
});
} else {
setupChannel(tc.generalChannel);
}
};
该行为很奇怪,因为问题不一致。
我的大多数代码与为laravel框架Twilio Docs提供的教程twilio相同
有没有一种方法可以检查唯一名称是否已经存在,然后仅加入其中?