0

我正在使用 quickblox 聊天 api 进行群聊。我正在使用用户名和密码创建聊天会话。这是我创建聊天会话的代码。

final QBUser user = new QBUser();
        user.setLogin(username);
        user.setPassword(password);

        QBAuth.createSession(user, new QBEntityCallbackImpl<QBSession>() {
            @Override
            public void onSuccess(QBSession session, Bundle args) {

                System.out.println("user  id " + session.getUserId());

                user.setId(session.getUserId());
                ((ApplicationSingleton) getParent().getApplication()
                        .getApplicationContext()).setCurrentUser(user);

                loginToChat(user);

            }

            @Override
            public void onError(List<String> errors) {

                editor.putBoolean("ISCHECKED", false);
                editor.putString("Username", "");
                editor.putString("Password", "");
                editor.commit();

                AlertDialog.Builder dialog = new AlertDialog.Builder(
                        getParent());
                dialog.setMessage("create session errors: " + errors).create()
                        .show();
                pDialog.dismiss();
            }
        });

但我想使用电子邮件和密码创建会话。任何人都有任何想法这样做。

4

1 回答 1

1

The same, but set an email instead of login

final QBUser user = new QBUser();
user.setEmail(email);
user.setPassword(password);
于 2015-02-09T09:48:21.273 回答