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
- Create a
LogoutRequest
object usingLogoutRequest.builder()
class by passing all the required parameters. - Call
logout()
function using the instance ofLMFeedClient
. - 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
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
refreshToken | String | Refresh token of the user. | |
deviceId | String | Unique id of the device. |