Logging Out

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

val user = User()
val token = "token"

client.disconnect(flushPersistence = false).enqueue { disconnectResult ->
  if (disconnectResult.isSuccess) {
    client.connectUser(user, token).enqueue { /* ... */ }
  } 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.