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

Logging Out

1
HWMSdk.getOpenApi.logout(HwmCallback<LogoutResult> hwmCallback)

API Description

This API is used to log out of an account.

Precautions

Call this API only when you have logged in.

Method Definition

1
2
3
4
5
    /**
     * Logs out.
     * @param hwmCallback Indicates the result callback.
     */
    void logout(HwmCallback<LogoutResult> hwmCallback);

Parameter Description

Table 1 Parameter description

Parameter

Mandatory

Type

Description

hwmCallback

Yes

HwmCallback<LogoutResult>

Callback object.

Table 2 LogoutResult description

Parameter

Type

Description

userUuid

String

User UUID, which is the unique user ID allocated by the system.

account

String

Login account.

thirdAccount

String

Third-party login account (in the app ID login scenario).

Return Values

None

Sample Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
         HWMSdk.getOpenApi(getActivity()).logout(new HwmCallback<LogoutResult>() {
            @Override
            public void onSuccess(LogoutResult result) {
                Log.i("", getContext(), "Logout succeeded");
            }

            @Override
            public void onFailed(int retCode, String desc) {
                Log.i("", getContext(), "Logout failed: " + retCode +"; " + desc).
            }
        });