Logout
To disconnect a user (for example you want to switch user profile or logout the user) you can call the logoutUser()
method.
Steps to logout User
- Use the
logoutUser()
function provided by thelmFeedClient
object created earlier. - Create an instance of
LogoutUserRequest
, as shown in the snippet and pass it to the above method. - Use the response as per your requirement
try {
const logoutRequest = {
deviceId: "<ENTER_DEVICE_ID>", // add deviceId only if you have register device id using registerDevice method
};
const response = await lmFeedClient.logoutUser(logoutRequest);
// Use the response as per your requirement.
} catch (error) {
// Use the error as per your requirement.
}
Models
LogoutUserRequest
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
deviceId | string | Unique id of the device. | ✔ |