QuickBlox / quickblox-android-sdk-releases

This repository contains binary distributions of Android products released by QuickBlox.
BSD 3-Clause "New" or "Revised" License
31 stars 15 forks source link

Roster throws Client is not logged in exception #23

Closed ilmian closed 3 years ago

ilmian commented 3 years ago

Trying to load roster throws "Client is not logged in" exception, even though user is already logged in to chat. I have confirmed that by trying to login in catch block, which as expected tells me You have already logged into chat.

try {
    if (contactsRoster != null)
      contactsRoster.reload();
} catch (SmackException.NotLoggedInException e) {
    e.printStackTrace();
} catch (SmackException.NotConnectedException e) {
    e.printStackTrace();
}

Looking in Roster class it looks like it is thrown from here.

if (!connection.isAuthenticated()) {
            throw new NotLoggedInException();
        }

Is there a way to re-authenticate the connection?