连接quickblox用户以与频道ID聊天

时间:2018-06-20 19:35:16

标签: android quickblox

我正在使用quickblox android sdk应用程序,在该应用程序中我想用唯一的频道ID连接两个用户进行聊天,然后说:“ 123456”。我想使用此频道ID注册两个用户并启用聊天功能。 我在聊天对话框中使用的代码如下:

ArrayList<Integer> occupantIdsList = new ArrayList<Integer>();
                occupantIdsList.add(53166574);
                occupantIdsList.add(53166639);

                QBChatDialog dialog = new QBChatDialog();
                dialog.setName("Chat with Garry and John");
                dialog.setPhoto("1786");
                dialog.setType(QBDialogType.GROUP);
                dialog.setOccupantsIds(occupantIdsList);
                QBChatDialog dialog1 = DialogUtils.buildDialog("Chat with Garry and John", QBDialogType.GROUP, occupantIdsList);

                QBRestChatService.createChatDialog(dialog1).performAsync(new QBEntityCallback<QBChatDialog>() {
                    @Override
                    public void onSuccess(QBChatDialog result, Bundle params) {

                        if(result!=null){
//                            QBChatDialog qbChatDialog=(QBChatDialog) lstChatDialogs.getAdapter().getItem(position);
                            Intent intent=new Intent(ChatDialogsActivity.this,ChatMessageActivity.class);
                            intent.putExtra(Common.DIALOG_EXTRA,result);
                            startActivity(intent);
                        }
                    }

                    @Override
                    public void onError(QBResponseException responseException) {
                        if(responseException!=null){

                        }
                    }
                });

0 个答案:

没有答案
相关问题