目录

AppParams

Class Info

public class AppParams

初始化入参类,在init方法中使用。

Public Constructors Summary

Constructors

public AppParams()

AppParams类的构造方法。

public AppParams(AccountAuthParams authScope)

AppParams类的构造方法,联运应用使用此构造函数。

public AppParams(AccountAuthParams authScope, AntiAddictionCallback antiaddictionCallback)

AppParams类的构造方法,authScope设置为AccountAuthParams.DEFAULT_AUTH_REQUEST_PARAM_GAME,antiaddictionCallback不为空,可实现游戏防沉迷。联运游戏使用此构造函数。

Public Method Summary

Qualifier and Type

Method Name and Description

AccountAuthParams

getAuthScope()

获取华为帐号授权Scope。

void

setAuthScope(AccountAuthParams authScope)

设置华为帐号授权Scope。

AntiAddictionCallback

getAntiAddictionCallback()

获取游戏防沉迷回调。

void

setAntiAddictionCallback(AntiAddictionCallback antiAddictionCallback)

设置游戏防沉迷回调。

String

getChannelId()

获取买量渠道ID。

Void

setChannelId(String channelId)

设置买量渠道ID。

Void

setExitCallback(ExitCallback exitCallback)

设置退出游戏回调。

ExitCallback

getExitCallback()

获取退出游戏回调。

Public Constructors

AppParams()

Constructors

public AppParams()

AppParams类的构造方法。

[h2]AppParams(authScope)

Constructors

public AppParams(AccountAuthParams authScope)

AppParams类的构造方法。

Parameters

Name

Description

authScope

华为帐号登录时的授权参数。

[h2]AppParams(authScope, antiaddictionCallback)

Constructors

public AppParams(AccountAuthParams authScope, AntiAddictionCallback antiaddictionCallback)

AppParams类的构造方法,authScope设置为AccountAuthParams.DEFAULT_AUTH_REQUEST_PARAM_GAME,antiaddictionCallback不为空,可实现游戏防沉迷。

Parameters

Name

Description

authScope

华为帐号登录时的授权参数。

antiaddictionCallback

游戏防沉迷回调。

根据中国国家新闻出版署的规定,所有网络游戏企业仅可在周五、周六、周日和法定节假日每日20时至21时向未成年人提供1小时网络游戏服务。游戏服务会自动根据新闻出版署的要求对未成年人的游戏时间进行统计,当超过规定时间时将结果回调给开发者。

Public Methods

[h2]getAuthScope

Method

public AccountAuthParams getAuthScope()

获取华为帐号授权Scope。

Returns

Type

Description

AccountAuthParams

华为帐号授权参数。

[h2]setAuthScope

Method

public void setAuthScope(AccountAuthParams authScope)

设置华为帐号授权Scope。

Parameters

Name

Description

authScope

华为帐号授权Scope,参见AccountAuthParams。

[h2]getAntiAddictionCallback

Method

public AntiAddictionCallback getAntiAddictionCallback()

获取游戏防沉迷回调。

Returns

Type

Description

AntiAddictionCallback

游戏防沉迷回调。

[h2]setAntiAddictionCallback

Method

public void setAntiAddictionCallback(AntiAddictionCallback antiAddictionCallback)

设置游戏防沉迷回调。

Parameters

Name

Description

antiAddictionCallback

游戏防沉迷回调,参见AntiAddictionCallback。

[h2]getChannelId

Method

public String getChannelId()

获取买量渠道ID。

Returns

Type

Description

String

买量渠道ID。

[h2]setChannelId

Method

public void setChannelId(String channelId)

设置渠道ID。

Parameters

Name

Description

channelId

买量渠道ID。

[h2]setExitCallback

Method

public void setExitCallback(ExitCallback exitCallback)

设置退出游戏回调。

Parameters

Name

Description

exitCallback

退出回调。

[h2]getExitCallback

Method

public ExitCallback getExitCallback()

获取设置退出游戏回调。

Returns

Name

Description

ExitCallback

退出回调。