从Android应用程序连接到quickblox chat api的错误

时间:2016-01-04 11:50:35

标签: android android-intent quickblox

我是stackoverflow和android开发的新手。我试图通过另一个Android应用程序连接到quickblox chat api.Below是代码。我无法连接并收到错误 - "User id and password null":

Java代码:

@Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);

        QBSettings.getInstance().fastConfigInit("xxxx", "xxxx", "xxxxx");

        ///new code for quickblox
        QBAuth.createSession(new QBUser("username", "password"), new QBEntityCallbackImpl<QBSession>() {
            @Override
            public void onSuccess(QBSession session, Bundle params) {
                QBChatService chatService;

                if (!QBChatService.isInitialized()) {
                    QBChatService.init(getApplicationContext());
                    chatService = QBChatService.getInstance();
                } else {
                    QBChatService.init(getApplicationContext());
                    chatService = QBChatService.getInstance();
                }

                final QBUser user = new QBUser("username", "password");
                chatService.login(user, new QBEntityCallbackImpl() {
                    @Override
                    public void onSuccess() {

                    }

                    @Override
                    public void onError(List errors) {
                        // errror
                    }
                });
            }

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

0 个答案:

没有答案