1

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

    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) {

    }
});

但我不知道如何在此处指示管理员。可能吗?谢谢你。

4

1 回答 1

0

添加管理员:

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

于 2018-09-06T15:04:42.190 回答