目录

AppParams

Class Info

public class AppParams

Initialization input parameter class, which is used in the init method.

Public Constructors Summary

Constructors

public AppParams()

Constructor of the AppParams class.

public AppParams(AccountAuthParams authScope)

Constructor of the AppParams class for joint operations apps.

public AppParams(AccountAuthParams authScope, AntiAddictionCallback antiaddictionCallback)

Constructor of the AppParams class for joint operations games. To implement game addiction prevention, set authScope to AccountAuthParams.DEFAULT_AUTH_REQUEST_PARAM_GAME, and do not leave antiaddictionCallback empty.

Public Method Summary

Qualifier and Type

Method Name and Description

AccountAuthParams

getAuthScope()

Obtains the authorization scope of a HUAWEI ID.

void

setAuthScope(AccountAuthParams authScope)

Sets the authorization scope of a HUAWEI ID.

AntiAddictionCallback

getAntiAddictionCallback()

Obtains the game addiction prevention callback.

void

setAntiAddictionCallback(AntiAddictionCallback antiAddictionCallback)

Sets the game addiction prevention callback.

String

getChannelId()

Obtains the paid traffic channel ID.

Void

setChannelId(String channelId)

Sets the paid traffic channel ID.

Public Constructors

AppParams()

Constructors

public AppParams()

Constructor of the AppParams class.

[h2]AppParams(authScope)

Constructors

public AppParams(AccountAuthParams authScope)

Constructor of the AppParams class.

Parameters

Name

Description

authScope

Authorization parameter used when a HUAWEI ID is used for sign-in.

[h2]AppParams(authScope, antiaddictionCallback)

Constructors

public AppParams(AccountAuthParams authScope, AntiAddictionCallback antiaddictionCallback)

Constructor of the AppParams class. To implement game addiction prevention, set authScope to AccountAuthParams.DEFAULT_AUTH_REQUEST_PARAM_GAME, and do not leave antiaddictionCallback empty.

Parameters

Name

Description

authScope

Authorization parameter used when a HUAWEI ID is used for sign-in.

antiaddictionCallback

Game addiction prevention callback.

In accordance with the latest notice issued by National Press and Publication Administration, online game providers are allowed to offer online game services to minors only from 20:00 to 21:00 on Fridays, weekends, and legal holidays. Game Service automatically collects the played time of minors. When the time exceeds the upper limit, you will receive the result callback.

Public Methods

[h2]getAuthScope

Method

public AccountAuthParams getAuthScope()

Obtains the authorization scope of a HUAWEI ID.

Returns

Type

Description

AccountAuthParams

HUAWEI ID authorization parameter.

[h2]setAuthScope

Method

public void setAuthScope(AccountAuthParams authScope)

Sets the authorization scope of a HUAWEI ID.

Parameters

Name

Description

authScope

HUAWEI ID authorization scope. For details, please refer to AccountAuthParams.

[h2]getAntiAddictionCallback

Method

public AntiAddictionCallback getAntiAddictionCallback()

Obtains the game addiction prevention callback.

Returns

Type

Description

AntiAddictionCallback

Game addiction prevention callback.

[h2]setAntiAddictionCallback

Method

public void setAntiAddictionCallback(AntiAddictionCallback antiAddictionCallback)

Sets the game addiction prevention callback.

Parameters

Name

Description

antiAddictionCallback

Game addiction prevention callback. For details, please refer to AntiAddictionCallback.

[h2]getChannelId

Method

public String getChannelId()

Obtains the paid traffic channel ID.

Returns

Type

Description

String

Paid traffic channel ID.

[h2]setChannelId

Method

public void setChannelId(String channelId)

Sets the channel ID.

Parameters

Name

Description

channelId

Paid traffic channel ID.