QBPrivateChatManager getting null

[亡魂溺海] 提交于 2020-01-01 17:16:06

问题


I am getting QBPrivateChatManager as null , I am using following code :

    QBChatService chatService = QBChatService.getIntance();
    privateChatManager = chatService.getPrivateChatManager();

getting privateChatManager as null.


回答1:


You must to create User session first

 QBAuth.createSession(new QBUser("garrysantos", "garrysantospass"), new QBEntityCallbackImpl<QBSession>() {
    @Override
    public void onSuccess(QBSession session, Bundle params) {
        // success
    }

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

See more : http://quickblox.com/developers/Android_XMPP_Chat_Sample




回答2:


chatService.getInstance().getPrivateChatManager();

is null if you're not logged in ti Chat

so you have to login to chat first and then call this method



来源:https://stackoverflow.com/questions/26710642/qbprivatechatmanager-getting-null

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!