经过几个小时的反复试验,我终于成功地进行了第一次API调用,在Flutter中发送了一条群消息。但我不确定我做事情的方式是否正确。不幸的是,文档并没有多大帮助。它可能会少得多,但信息量却要多得多。如果有人能回答这里的所有问题,我将非常高兴,因为答案将对许多Connecty Cube初学者有用。
现在,我进行调用的顺序如下:
import 'package:connectycube_sdk/connectycube_chat.dart' as cc;
await cc.init(APP_ID, AUTH_KEY, AUTH_SECRET);
cubesession = await cc.createSession(); //create app session
//registeredUser = await cc.signUp(user); //if necessary
myuser = await cc.signInByLogin(userDocId, password);
cubeSession = await cc.createSession(myuser); //upgrade to user session
createdDialog = await cc.createDialog(newDialog); //is this for one time only? I can set the dialogId in the newDialog object but it is overwritten by a random uuid in the console. We should know what we can set and not clearly.
await cc.CubeChatConnection.instance.login(myuser); //login?? bad choice of a method mate. This starts the xmpp 2 way connection I guess.
subscribe and listen to cc.CubeChatConnection.instance.chatMessagesManager.chatMessagesStream
请告诉我上述调用API方法的方式/顺序是否正确。
另外,如何以及以何种顺序发布资源?CubeUser/CubeSession/CubeDialog/chatMessagesStream/CubeChatConnection
如何将自定义属性设置为CubeUser?我想传递我的Firebase用户文档id
如何将自定义属性设置为CubeDialog?我想传递我的Firebase帖子文档id。我看到有一个字符串名称属性,但我想要使用它的真正目的。
如何加入/离开CubeDialog?(与添加和删除占有者不同)我们总是需要创建一个对话框吗?或者我们需要获得我们所在的对话框,然后以某种方式离开它们?
占有者应该有能力离开一个对话框,而不是管理员删除它们。我们该怎么做呢?
为什么id是整数?
为什么高级FLutter接口没有空的返回类型?
参数参数不明确。它们只是Map对象,所以我们不知道要在其中放入什么关键字段。例如:
Future<PagedResult<CubeDialog>> getDialogs([Map<String, dynamic> params]) {
return GetDialogsQuery(params).perform();
}
//What keys should I put in params to fully use pagination?
发布于 2020-11-23 16:33:07
there是关于你在GitHub上的问题的帖子
https://stackoverflow.com/questions/64946158
复制相似问题