0

I have been checking the SDK Manual (http://sdk.quickblox.com/android/) but I didn't figure out how to logout from chat.

I want to LogOut because API saves your pending messages when your are logged out.

Anyone has an idea about how to do that?

MarcForn
  • 3,321
  • 7
  • 25
  • 39
  • I have found the solution in the following link: http://www.igniterealtime.org/builds/smack/docs/latest/javadoc/org/jivesoftware/smack/XMPPConnection.html – MarcForn Nov 09 '13 at 21:17

2 Answers2

1

Here is the shutdown(Presence unavailablePresence) method in XMPPConnection class

Rubycon
  • 18,156
  • 10
  • 49
  • 70
1

Here are the codes from Quickblox

boolean isLoggedIn = chatService.isLoggedIn();
if(!isLoggedIn){
    return;
}

chatService.logout(new QBEntityCallbackImpl() {

    @Override
    public void onSuccess() {
        // success

        chatService.destroy();
    }

    @Override
    public void onError(final List list) {

    }
});

hope this helps :)

Ankit Arora
  • 117
  • 4