Configuration class¶
Using the Configuration class, you can retrieve (get) or change (set) configuration values during game app runtime. For example, when retrieving game server information, use the getServerId() method, and when changing it, use the setServerId() method.
As an example of using the Configuration class, you can change the user's zone settings during game app execution with the Configuration class.
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 setZone method of the Configuration class must be called before invoking the setup function to work correctly.
Usage scenarios of the configuration class¶
If you need to change the SDK settings while the game app is running, here are the cases.
Before SDK initialization¶
Before initializing the SDK, reflect the game server or game language in the settings.
After SDK initialization and before the server maintenance popup¶
If users select a game server after SDK initialization, show the server selection UI first and apply their selection to the settings. Then show the server maintenance popup.
Example: Game Server Selection UI 
After entering the game¶
You can add a game server or game language selector to the game settings or another menu during gameplay. If users change the server or language through that UI, apply their selection to the configuration.
Example: Game Language Selection UI 
Other situations¶
Changes the previously set values due to various situations such as changes in game information depending on game planning and other circumstances.
Info
Some settings are read-only at runtime when you use the Configuration class.
Example of using the Configuration class¶
Here is an additional guide on using the Configuration class.
Theme settings¶
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 (runtime settings) with the methods in the Configuration class overrides the values set in hive_config.xml (build time settings). In other words, the values set by the Configuration class take higher priority. However, the values set by the Configuration class are prioritized within the SDK, and the existing values in the hive_config.xml file are not changed.
For example, even if you set zone to sandbox in the above zone configuration in hive_config.xml, after changing this value to real with the Configuration class and initializing the SDK, the SDK will operate based on real. However, the zone in hive_config.xml will still remain as sandbox.
Read-only settings in the Configuration class (Get)¶
The following settings are read-only through the get methods of the Configuration class.
| Item | OS | SDK Features | Description | SDK Default |
|---|---|---|---|---|
| hiveSDKVersion | Android, iOS, Windows, macOS | Hive SDK Common | The Hive SDK version. | Applied Hive SDK version value |
| referenceSDKVersion | Android, iOS, Windows, macOS | Hive SDK Common | The SDK version referenced by the Hive SDK. | Library and version information referenced by the applied Hive SDK |
| hiveCountry | Android, iOS, Windows, macOS | Hive SDK Common | The country code determined by the Hive SDK server. | Information delivered from the Hive SDK server |
| appId | Android, iOS, Windows, macOS | Hive SDK Common | App build identifier. | - Android: Base package name of the app - iOS: Bundle ID |
| serverId | Android, iOS, Windows, macOS | Hive SDK Common | Each game server identifier that can be verified when operating servers regionally in the game. Must be written according to the Hive identifier policy. | Blank |
| zone | Android, iOS, Windows, macOS | Hive SDK Common | The server the Hive SDK client connects to.
| REAL |
| useLog | Android, iOS, Windows, macOS | Hive SDK Common | Whether to enable logs for the internal operations of the Hive client. When logs are enabled, they will be output to the development tool screen.
| false |
| channel | Android, iOS, Windows, macOS | Hive SDK Common | The platform for login and in-app support services used by the app. When logging in to external social platforms or using in-app purchases through the SDK, this corresponds to C2S. Used for SDK Analytics data collection.
| C2S |
| market | Android, iOS, Windows, macOS | Hive SDK Common | The storefront for in-app purchases. The SDK uses this setting for Analytics data collection.
| Blank |
| httpConnectTimeout | Android, iOS, Windows, macOS | Hive SDK Common | Timeout in seconds for HTTP Connect used internally by the Hive client. The default is 8 seconds. Change this value only in exceptional cases. | 8 (unit: seconds) |
| httpReadTimeout | Android, iOS, Windows, macOS | Hive SDK Common | Timeout in seconds for HTTP Read used internally by the Hive client. The default is 8 seconds. Change this value only in exceptional cases (such as when confirmed network delays or disconnections disrupt normal log collection). | 8 (unit: seconds) |
| gameLanguage | Android, iOS, Windows, macOS | Hive SDK Common | The game language set in the SDK. | Device language setting |
| ageGateU13 | Android, iOS, Windows, macOS | Provisioning | Whether to apply COPPA ageGateU13. To apply it, register the COPPA terms in Hive Console and set this value to true before initializing Hive SDK. To leave it disabled, register terms other than COPPA in Hive Console and set this value to false before initializing Hive SDK.
| false |
| agreementDetermineBase | Android, iOS, Windows, macOS | Provisioning | Controls how consent to the terms is collected. Choose device or account. The default is device.
| device |
| enableGameController | Android, Windows | Hive SDK Common | Enables or disables the game controller in the Hive SDK UI.
get function to retrieve the current value. | true |
| usePrivateBrowsingForAuth | Windows | Authentication | Controls whether Google sign-in uses incognito mode.
| true |
| maxGameLogSize | Android, iOS, Windows, macOS | Analytics | Maximum number of game logs stored as unstructured data files. The default is 50. The Hive SDK Analytics server collects this value. | 50 |
| analyticsSendLimit | Android, iOS, Windows, macOS | Analytics | Maximum number of Analytics logs sent per transmission cycle. The default is 5. | 5 |
| analyticsQueueLimit | Android, iOS, Windows, macOS | Analytics | Maximum number of Analytics logs that can be queued. The default is 50. | 50 |
| analyticsSendCycle | Android, iOS, Windows, macOS | Analytics | Interval for sending Analytics logs, in seconds. The SDK sends logs at the configured interval. The default is 1 second. | 1 |
| hiveTheme | Android, iOS, Windows, macOS | SDK Common | Select a light or dark theme. | HiveTheme.HiveLight |
Settings you can change with the Configuration class (Set)¶
The items that can be changed (set) with the Configuration class methods are as follows. Mandatory items must be entered, while optional items can be entered as needed. If optional items are not entered, they will operate with the default values of the SDK. Even if it is a mandatory item, if it has already been entered in hive_config.xml and does not need to be changed at runtime, there is no need to change it with the Configuration class.
Warning
The serverId is a value that must only be set at runtime. Therefore, this value must be set using the Configuration class.
| Item | OS | SDK Features | Description | Required | SDK Default Value |
|---|---|---|---|---|---|
| appId | Android, iOS, Windows, macOS | SDK Common | App build identifier. | X | - Android: Base package name of the app - iOS: Bundle ID |
| serverId | Android, iOS, Windows, macOS | SDK Common | Each game server identifier that can be verified when operating servers regionally in the game. Must be written according to the Hive identifier policy. | O | Blank |
| zone | Android, iOS, Windows, macOS | SDK Common | The server the Hive SDK connects to.
| X | REAL |
| useLog | Android, iOS, Windows, macOS | SDK Common | Whether to enable logs for the internal operations of the Hive client. When logs are enabled, they will be output to the development tool screen.
| X | false |
| channel | Android, iOS, Windows, macOS | SDK Common | The platform for login and in-app support services used by the app. When logging in to external social platforms or using in-app purchases through the SDK, this corresponds to C2S. Used for SDK Analytics data collection.
| O | C2S |
| market | Android, iOS, Windows, macOS | SDK Common | The storefront for in-app purchases. The SDK uses this setting for Analytics data collection.
| O | Blank |
| httpConnectTimeout | Android, iOS, Windows, macOS | SDK Common | Timeout in seconds for HTTP Connect used internally by Hive SDK. The default is 8 seconds. Change this value only in exceptional cases. | X | 8 (unit: seconds) |
| httpReadTimeout | Android, iOS, Windows, macOS | SDK Common | Timeout in seconds for HTTP Read used internally by Hive SDK. The default is 8 seconds. Change this value only in exceptional cases (such as when confirmed network delays or disconnections disrupt normal log collection). | X | 8 (unit: seconds) |
| gameLanguage | Android, iOS, Windows, macOS | SDK Common | The game language set in the SDK. | X | Device language setting |
| ageGateU13 | Android, iOS, Windows, macOS | Provisioning | Whether to apply COPPA ageGateU13. To apply it, register the COPPA terms in Hive Console and set this value to true before initializing Hive SDK. To leave it disabled, register terms other than COPPA in Hive Console and set this value to false before initializing Hive SDK.
| X | false |
| agreementDetermineBase | Android, iOS, Windows, macOS | Provisioning | Controls how consent to the terms is collected. Choose device or account. The default is device.
| X | device |
| enableGameController | Windows | SDK Common | Enables or disables the game controller in the SDK UI.
get function to retrieve the current value. | X | true |
| usePrivateBrowsingForAuth | Windows | Authentication | Controls whether Google sign-in uses incognito mode.
| X | true |
| maxGameLogSize | Android, iOS, Windows, macOS | Analytics | Maximum number of game logs stored as unstructured data files. The default is 50. The Analytics server collects this value. | X | 50 |
| analyticsSendLimit | Android, iOS, Windows, macOS | Analytics | Maximum number of Analytics logs sent per transmission cycle. The default is 5. | X | 5 |
| analyticsQueueLimit | Android, iOS, Windows, macOS | Analytics | Maximum number of Analytics logs that can be queued. The default is 50. | X | 50 |
| analyticsSendCycle | Android, iOS, Windows, macOS | Analytics | Interval for sending Analytics logs, in seconds. The SDK sends logs at the configured interval. The default is 1 second. | X | 1 |
| hiveTheme | Android, iOS, Windows, macOS | SDK Common | Select a light or dark theme. | X | HiveTheme.HiveLight |
Note
When applying COPPA ageGateU13, only the device(device)-based terms consent popup can be displayed.
When applying COPPA ageGateU13, if any user responds that they are 13 years or older during the terms consent process, the SDK will not apply COPPA ageGateU13 to that user. However, the value set in hive_config.xml (true) itself does not change.
Unsupported items¶
The following are the methods of the Configuration class that are no longer supported.
| Item | OS | SDK Features | Description | Required | SDK Default Value |
|---|---|---|---|---|---|
| permissions | Android | SDK Common | (deprecated from v4.16.3) Whether to request permissions set by permission type. The permission name is specific to Android features. | X | None |
| hivePermissionViewOn | Android | SDK Common | (deprecated from v4.162) Whether to display the SDK permission notice popup.
| X | true |
| company | Android, iOS, Windows | SDK Common | (deprecated from v4.23.0) The name of the game publishing company. | X | None |