Skip to main content

Logout

To disconnect a user (say that you’re for instance logging out and logging in as someone new) you can call the logout() method.

Steps to logout User

  1. Create a LogoutRequest object using LogoutRequest.builder() class by passing all the required parameters.
  2. Call logout() function using the instance of LMFeedClient.
  3. Process the response (LMResponse<NoData>) as per your requirement.
// object of LogoutRequest
let request = LogoutRequest.builder()
.refreshToken(refreshToken) // refresh token of the user
.deviceId(deviceId) // unique id of the device
.build()
LMFeedClient.shared.logout(request) { response in
// get response (LMResponse<NoData>)
if (response.success) {
// process user logged out
processResponse()
} else {
// your function to process error message
processError(response.errorMessage)
}
}

Models

LogoutRequest

VARIABLETYPEDESCRIPTIONOPTIONAL
refreshTokenStringRefresh token of the user.
deviceIdStringUnique id of the device.