Skip to content

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

using hive;  

Configuration.setZone(ZoneType.REAL);

API Reference: hive::Configuration::setZone

#include <HIVE_SDK_Plugin/HIVE_CPP.h>    
using namespace std;    
using namespace hive;      

Configuration::setZone(ZoneType::REAL);

API Reference: Configuration.setZone

import com.hive.Configuration    

Configuration.zone = Configuration.ZoneType.REAL

API Reference: Configuration.setZone

import com.hive.Configuration;    

Configuration.INSTANCE.setZone(Configuration.ZoneType.REAL);

API Reference: ConfigurationInterface.setZone

import HIVEService    

ConfigurationInterface.setZone(.real)

API Reference: HIVEConfiguration:setZone

#import <HIVEService/HIVEService-Swift.h>    

[HIVEConfiguration setZone: HIVEZoneTypeReal];
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

using hive;

Configuration.setHiveTheme(HiveThemeType.hiveLight);
Configuration.setHiveTheme(HiveThemeType.hiveDark);

API Reference: hive::Configuration::setHiveTheme

#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace std;
using namespace hive;

Configuration::setHiveTheme(HiveThemeType::hiveLight);
Configuration::setHiveTheme(HiveThemeType::hiveDark);

API Reference: hiveTheme

import com.hive.Configuration

Configuration.hiveTheme = HiveTheme.hiveLight
Configuration.hiveTheme = HiveTheme.hiveDark

API Reference: Configuration.setHiveTheme

import com.hive.Configuration;

Configuration.INSTANCE.setHiveTheme(Configuration.HiveTheme.HiveLight);
Configuration.INSTANCE.setHiveTheme(Configuration.HiveTheme.HiveDark);

API Reference: HIVEConfiguration:setHiveTheme

#import <HIVEService/HIVEService-Swift.h>

[HIVEConfiguration setHiveTheme: HIVEThemeTypeHiveLight];
[HIVEConfiguration setHiveTheme: HIVEThemeTypeHiveDark];

API Reference: HIVEConfiguration:setHiveTheme

import HIVEService

ConfigurationInterface.setHiveTheme(.hiveLight)
ConfigurationInterface.setHiveTheme(.hiveDark)

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.
  • real: Operating server
  • sandbox: Test server
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.
  • true: Enable logging
  • false: Disable logging
X `false`
company This is the game publishing company.
  • C2S: Com2uS Games
  • GVI: Com2uS Holdings Games
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.
  • GO: Google Play Store
  • LE: Com2uS Lebi
  • AP: Apple App Store
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.
  • true: Apply COPPA ageGateU13 to the Hive SDK
  • false: Do not apply COPPA ageGateU13 to 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`.
  • If you select device, the terms and conditions consent popup will be displayed during the initialization stage, AuthV4.setup(), and consent will be obtained only once based on the device. Once consent is obtained based on the device, the terms and conditions consent will not be obtained even if the user logs in with a different account on the same device. You can use resetAgreement() to clear the terms and conditions consent record.
  • If you select account, the terms and conditions consent popup will be displayed during login, and consent will be obtained only once per PlayerId. This can only be used when COPPA ageGateU13 is not applied. You cannot use `resetAgreement()` to clear the terms and conditions consent record. Marketing tracking tools will operate after the terms and conditions consent.
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.
  • External memory permission
    • true: Show permission request window
    • false : Do not show permission request window
  • Tag name: sdwrite
Derpecated since v4.16.3
hivePermissionViewOn This is whether or not to display the Hive SDK permission notice popup.
  • true: Display
  • false: Do not display
Derpecated since v4.16.2