Class Info |
|---|
public class AppParams 初始化入参类,在init方法中使用。 |
Constructors |
|---|
public AppParams() AppParams类的构造方法。 |
public AppParams(AccountAuthParams authScope) AppParams类的构造方法,联运应用使用此构造函数。 |
public AppParams(AccountAuthParams authScope, AntiAddictionCallback antiaddictionCallback) AppParams类的构造方法,authScope设置为AccountAuthParams.DEFAULT_AUTH_REQUEST_PARAM_GAME,antiaddictionCallback不为空,可实现游戏防沉迷。联运游戏使用此构造函数。 |
Qualifier and Type | Method Name and Description |
|---|---|
| 获取华为帐号授权Scope。 | |
void | setAuthScope(AccountAuthParams authScope) 设置华为帐号授权Scope。 |
| 获取游戏防沉迷回调。 | |
void | setAntiAddictionCallback(AntiAddictionCallback antiAddictionCallback) 设置游戏防沉迷回调。 |
String | 获取买量渠道ID。 |
Void | setChannelId(String channelId) 设置买量渠道ID。 |
Void | setExitCallback(ExitCallback exitCallback) 设置退出游戏回调。 |
| 获取退出游戏回调。 |
AppParams()
Constructors |
|---|
public AppParams() AppParams类的构造方法。 |
Constructors |
|---|
public AppParams(AccountAuthParams authScope) AppParams类的构造方法。 |
Parameters
Name | Description |
|---|---|
authScope | 华为帐号登录时的授权参数。 |
Constructors |
|---|
public AppParams(AccountAuthParams authScope, AntiAddictionCallback antiaddictionCallback) AppParams类的构造方法,authScope设置为AccountAuthParams.DEFAULT_AUTH_REQUEST_PARAM_GAME,antiaddictionCallback不为空,可实现游戏防沉迷。 |
Parameters
Name | Description |
|---|---|
authScope | 华为帐号登录时的授权参数。 |
antiaddictionCallback | 游戏防沉迷回调。 根据中国国家新闻出版署的规定,所有网络游戏企业仅可在周五、周六、周日和法定节假日每日20时至21时向未成年人提供1小时网络游戏服务。游戏服务会自动根据新闻出版署的要求对未成年人的游戏时间进行统计,当超过规定时间时将结果回调给开发者。 |
Method |
|---|
public AccountAuthParams getAuthScope() 获取华为帐号授权Scope。 |
Returns
Type | Description |
|---|---|
华为帐号授权参数。 |
Method |
|---|
public void setAuthScope(AccountAuthParams authScope) 设置华为帐号授权Scope。 |
Parameters
Name | Description |
|---|---|
authScope | 华为帐号授权Scope,参见AccountAuthParams。 |
Method |
|---|
public AntiAddictionCallback getAntiAddictionCallback() 获取游戏防沉迷回调。 |
Returns
Type | Description |
|---|---|
游戏防沉迷回调。 |
Method |
|---|
public void setAntiAddictionCallback(AntiAddictionCallback antiAddictionCallback) 设置游戏防沉迷回调。 |
Parameters
Name | Description |
|---|---|
antiAddictionCallback | 游戏防沉迷回调,参见AntiAddictionCallback。 |
Method |
|---|
public String getChannelId() 获取买量渠道ID。 |
Returns
Type | Description |
|---|---|
String | 买量渠道ID。 |
Method |
|---|
public void setChannelId(String channelId) 设置渠道ID。 |
Parameters
Name | Description |
|---|---|
channelId | 买量渠道ID。 |
Parameters
Name | Description |
|---|---|
exitCallback | 退出回调。 |