颤音异常错误创建streamchat频道
您好,我正在尝试使用streamchat.io api来构建聊天应用程序,但是当我尝试创建一个频道时,我会得到此错误 streamChatnetworkerror(streamchatnetworkerror(代码:1000,消息:未经授权,未定义的标记)))
这是我设置的代码加入频道
Future<void> createChannel(BuildContext context) async {
try {
final currentUser = FirebaseAuth.instance.currentUser;
final userID = currentUser!.uid;
final client = StreamChatCore.of(context).client;
final channel = client.channel("messaging", id: userID, extraData: {
"name": _name.text.trim(),
});
AccountUpdate.storeChannel(channel);
await channel.watch();
print("this is the channel output $channel");
} catch (e) {
print(e);
}
} 我已经禁用了验证检查,因此无需秘密
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在流团队的帮助下,我发现您需要首先建立一个连接的用户才能观看频道
编辑:上述开发人员令牌(需要禁用身份验证)。在生产环境中,您需要使用流的后端客户端 。或出于开发目的,您可以使用在线代币发电机有关
连接和身份验证的更多信息: https://getStream.io/chat/chat/chat/docs/flutter-dart/tokens_and_authentication/?language= darg=
dart https://getStream.io/chat/flutter/tutorial/“ rel =“ nofollow noreferrer”>入门教程寻求更多帮助。
With help from the Stream team, I figured out that you need to establish a connected user first in order to watch a channel
EDIT: The above makes use of developer tokens (which requires authentication to be disabled). In a production environment you will need to generate frontend tokens using one of Stream's backend clients. Or for development purposes you can use the online token generator https://getstream.io/chat/docs/flutter-dart/token_generator/?language=dart
More info on connections and authentication: https://getstream.io/chat/docs/flutter-dart/tokens_and_authentication/?language=dart
See the Stream Chat Flutter getting started tutorial for more help.