我可以使用 ConnectyCube SDK 分配聊天管理员吗?



我正在尝试使用ConnectyCube Android和iOS SDK来构建我的应用程序,并且需要能够为聊天分配管理员。 对于安卓,我尝试了以下代码:

ArrayList<Integer> occupantIds = new ArrayList<Integer>();
occupantIds.add(34);
occupantIds.add(35);
occupantIds.add(36);
ConnectycubeChatDialog dialog = new ConnectycubeChatDialog();
dialog.setType(ConnectycubeDialogType.GROUP);
dialog.setOccupantsIds(occupantIdsList);
dialog.setName("Hawaii party");
//or just use DialogUtils
//ConnectycubeChatDialog dialog = DialogUtils.buildDialog("Hawaii party", ConnectycubeDialogType.GROUP, occupantIds);
ConnectycubeRestChatService.createChatDialog(dialog).performAsync(new EntityCallback<ConnectycubeChatDialog>() {
@Override
public void onSuccess(ConnectycubeChatDialog createdDialog, Bundle params) {
}
@Override
public void onError(ResponseException exception) {
}
});

但我不明白我如何在那里指示管理员。可能吗? 谢谢。

添加管理员:

DialogRequestBuilder updateBuilder = new DialogRequestBuilder();
updateBuilder.addAdminsIds(17616, 17617);
ConnectycubeRestChatService.updateChatDialog(groupDialog, updateBuilder).performAsync(new EntityCallback<ConnectycubeChatDialog>() {
@Override
public void onSuccess(ConnectycubeChatDialog result, Bundle params) {
}
@Override
public void onError(ResponseException responseException) {
}
});

删除管理员:

DialogRequestBuilder updateBuilder = new DialogRequestBuilder();
updateBuilder.removeAdminsIds(17616, 17617);
ConnectycubeRestChatService.updateChatDialog(groupDialog, updateBuilder).performAsync(new EntityCallback<ConnectycubeChatDialog>() {
@Override
public void onSuccess(ConnectycubeChatDialog result, Bundle params) {
}
@Override
public void onError(ResponseException responseException) {
}
});

更多信息在这里 https://developers.connectycube.com/android/messaging?id=addremove-admins

最新更新