我正在尝试使用ConnectyCube安卓和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) {
}
});但我不知道该如何指示那里的管理员。有可能吗?谢谢。
发布于 2018-09-06 23:04:42
添加管理员:
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
https://stackoverflow.com/questions/52062225
复制相似问题