Skip to main content

logout

Description

info

The APP needs to wait for the logout callback to succeed.
After a successful logout, you will no longer receive new messages sent by others. If switching accounts, you need to wait for user A's logout callback to succeed before calling user B's login, otherwise the login may fail.
If the APP lifecycle is consistent with the SDK lifecycle, you can call logout when the user exits the APP.

Note

(1) When receiving onKickedOffline and onUserTokenExpired from the SDK, it means being kicked offline, the token is invalid, or the token has expired.
After the SDK triggers this internally, it will automatically call logout, so there is no need to make an external call to the logout function.

Function Prototype


- (void)logoutWithOnSuccess:(nullable OIMSuccessCallback)onSuccess
onFailure:(nullable OIMFailureCallback)onFailure;

Input Parameters

None

Return Result

Parameter NameParameter TypeDescription
onSuccessOIMSuccessCallbackSuccess return
onFailureOIMFailureCallbackFailure return

Code Example


[OIMManager.manager logoutWithOnSuccess:^(NSString * _Nullable data) {
} onFailure:^(NSInteger code, NSString * _Nullable msg) {
}];