Logging Out

User can be logged out by disconnecting the user. After disconnection, call connect user for logging in with another user.

User user = new User();
String token = "token";

client.disconnect(true).enqueue(disconnectResult -> {
  if (disconnectResult.isSuccess()) {
    client.connectUser(user, token).enqueue(loginResult -> { /* ... */ });
  } else {
    // Handle result.error()
  }
});

Disable Push Notifications

Additionally, you’ll want to stop the user from receiving further push notifications by unregistering their device.

© Getstream.io, Inc. All Rights Reserved.