logout
Introduction
Logout
Generally, if your application's lifecycle is the same as the IM SDK's lifecycle, there is no need to log out before exiting the application.
In special cases, for example, if you use the IM SDK only after entering a specific UI and no longer use it after exiting the UI, you can call the this method to log out of the SDK, after which you will no longer receive new messages.
Please logout first, than can login to another user, if you have the needs to switch from different accounts.
Parameter details
This API has no parameters
Returned template
V2TimCallback
{
code : int
desc : String
}
Return value details
name | type | description |
---|---|---|
code | int | Request result: Error codes. 0 means success. |
desc | String | The description of the failure. |
Code example
final CoreServicesImpl coreInstance = TIMUIKitCore.getInstance();
V2TimCallback logoutRes = await coreInstance.logout();
if (logoutRes.code == 0) {
}