Configuration class¶
The Configuration
class allows you to retrieve (get
) or modify (set
) configuration values while the app is running. For example, you can use the getServerId()
method to retrieve app server information and the setServerId()
method to modify it.
As an example of using the Configuration
class, you can change the user's zone
setting to the Configuration
class while the app is running.
API Reference: hive.Configuration.setZone
API Reference: hive::Configuration::setZone
API Reference: Configuration.setZone
API Reference: Configuration.setZone
API Reference: ConfigurationInterface.setZone
API Reference: HIVEConfiguration:setZone
Note
The Configuration
class setZone
method must be called before the setup
function is called for it to work properly.
Configuration class usage scenarios¶
You need to change the Hive SDK settings during the app execution in the following cases.
Before Hive SDK initialization¶
Reflects game server or game language settings before initializing the Hive SDK.
After Hive SDK initialization ~ before server check popup¶
This is the case when the user selects the game server before displaying the server check popup after initializing the Hive SDK. After initializing the Hive SDK, expose the game server selection UI and reflect the game server selected by the user in the settings. After executing this process, display the server check popup.
Example: Game server selection UI
After entering the game¶
If the user changes the game language or game server in the game settings after entering the game, you can create a game server or game language change UI in the game settings or other menus while playing the game. If the user changes the server or language using this UI, you should also reflect this information in the settings.
Example: Game language selection UI
Other situations¶
Changes the existing setting value in various situations, such as when the game information changes due to game planning or other situations.
Note
You can change the value, but there are some items that cannot be retrieved.
Configuration class usage examples¶
Here are some more examples of using the Configuration
class.
Hive theme setting¶
You can expose the dark theme using Configuration.setHiveTheme
.
API Reference: hive.Configuration.setHiveTheme
API Reference: hive::Configuration::setHiveTheme
API Reference: hiveTheme
API Reference: Configuration.setHiveTheme
API Reference: HIVEConfiguration:setHiveTheme
API Reference: HIVEConfiguration:setHiveTheme
Configuration class and hive_config.xml file¶
Changing the settings through the methods in the Configuration
class will overwrite the values set in hive_config.xml. In other words, the values set by the Configuration
class have a higher priority. However, the Hive SDK uses the values set by the Configuration
class internally, and the existing values in the hive_config.xml file are not changed.
For example, even if you set the zone
to sandbox
in hive_config.xml in the zone
setting above, if you change this value to real
using the Configuration
class and initialize the Hive SDK, the Hive SDK will operate based on real
. However, the zone
in hive_config.xml will remain sandbox
.
Configuration class retrievable only settings¶
The configuration items that can only be retrieved (get
) using the Configuration
class methods are as follows.
Item | Description |
---|---|
hiveSDKVersion | This is the Hive SDK version. |
referenceSDKVersion | This is the SDK version that the Hive SDK references. |
hiveCountry | This is the country code determined by the Hive SDK server. |
Configuration class modifiable settings¶
The items that can be modified (set
) using the Configuration
class methods are as follows. These are the same items as the Hive SDK Common Setting Items that are pre-configured in hive_config.xml before building the app. Required items must be entered, and optional items are entered as needed. If you do not enter optional items, the Hive SDK will operate with default values.
Item | Description | Required | SDK Default Value |
---|---|---|---|
appId | This is the game build identifier. | X | Android: App default package name, iOS: Bundle ID |
serverId | This is the identifier of each game server that can be checked when the game operates the server by region. It must be written according to the Hive identifier policy. | O | Blank |
zone | This is the server that the Hive client connects to.
| X | `REAL` |
useLog | This is whether or not to activate logging for the internal operation of the Hive client. If you enable logging, it will output logs to the development tool screen.
| X | `false` |
company | This is the game publishing company.
| O | Blank |
channel | This is the login service platform used by the game app. C2S: Hive platform (default) | O | `C2S` |
market | This is the market where in-app purchases are paid.
| O | Blank |
httpConnectTimeout | This is the timeout time (in seconds) for the HTTP Connect used internally in the Hive client. The default value is set to 8 seconds, and changing the value is prohibited unless there are special circumstances. | X | `8`(unit: seconds) |
httpReadTimeout | This is the timeout time (in seconds) for the HTTP Read used internally in the Hive client. The default value is set to 8 seconds, and changing the value is prohibited unless there are special circumstances. | X | `8`(unit: seconds) |
gameLanguage | This is the game language set in the Hive SDK. | X | `en` |
ageGateU13 | This is whether to apply COPPA ageGateU13. To apply COPPA ageGateU13 to the Hive SDK, you need to register the COPPA terms and conditions in the Hive console and set this value to true before initializing the Hive SDK. To not apply COPPA ageGateU13, you need to register terms and conditions other than the COPPA terms and conditions in the Hive console and set this value to false before initializing the Hive SDK.
| X | `false` |
agreementDetermineBase | Determines the criteria for receiving consent to the terms and conditions. You can select `device` or `account`, and the default value is `device`.
| X | `device` |
Note
When COPPA ageGateU13 is applied, only the device
based terms and conditions consent popup can be displayed. If a user responds that they are 13 years old or older during the terms and conditions consent process, the Hive SDK will not apply COPPA ageGateU13 to that user. However, the value set in hive_config.xml (true
) itself will not change.
Unsupported items¶
The following are the methods in the Configuration
class that are no longer supported.
Item | Description | Notes |
---|---|---|
permissions | This is whether or not to request permissions by permission type. This is an Android-only feature.
| Derpecated since v4.16.3 |
hivePermissionViewOn | This is whether or not to display the Hive SDK permission notice popup.
| Derpecated since v4.16.2 |