Updated on 2024-07-30 GMT+08:00

Account Status Change Notification

You can configure listeners for account-related notification callbacks to monitor scenarios such as account expiration.

Application Scenarios

Account kicked out: onKickedOut

Token expired: onTokenInvalid

Account locked: onAccountLocked

Account or password error: onAccountOrPasswordError

Precautions

sdkConfig takes effect only when this configuration is passed during SDK initialization.

Sample Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
sdkConfig.setAccountEventHandle(new IAccountEventHandle() {
        @Override
        public void onKickedOut(@Nullable KickOutState kickOutState) {
            Log.i(TAG, "Your account has logged in on another device.");
        }
        @Override
        public void onAccountOrPasswordError(@Nullable AccountOrPasswordErrorState accountOrPasswordErrorState) {    
            Log.i(TAG, "onAccountOrPasswordError");
        }
        @Overridepublic void onTokenInvalid(@Nullable TokenInvalidState tokenInvalidState) { 
            // After the token expires, you need to log out and log in again. Otherwise, basic functions such as meeting creation and scheduling will be affected.
            Log.i(TAG, "onTokenInvalid");   
        }
        @Override
        public void onAccountLocked(@Nullable AccountLockedState accountLockedState) {    
            Log.i(TAG, "onAccountLocked"); 
        }
    });