How you implement Hive depends on the game engine you use and the platform on which the game app runs. Regardless of the engine or platform, the settings for Hive are defined in a file called hive_config.xml. The hive_config.xml file must be included in your game project. This file can be used to set the value easily. After game execution, you can modify the setting value at runtime by using the method in the Configuration class provided by Hive.
Search and Change the Configuration
Configuration in File
Hive SDK setting file has .xml format, and Hive Client refers values in this file when initializing SDK files. Static values are recommended to set in hive_config.xml file that do not change while the app is running. This configuration file name must be hive_config.xml and must be located in the following path.
– Unity 2021 and higher:
– Prior to Unity 2021:
Check the Items available to configure for more details of items and permissions.
Changing Hive Settings at runtime
Searching or changing Hive setting values are available as well while user plays a game. Configuration class provides the methods which add get
or set
on the name of each item. For example, getServerId()
is for searching, and setServerId()
is for changing the value of game server. Some items such as game language are for settings only. If you need more details, check the get or set permissions by item in the Item Information.
It is necessary to change Hive settings in the following cases.
- Before initializing Hive SDK
Set the game server or game language in the Configuration class before initializing Hive SDK. - When the user selects a game server before displaying Server Maintenance popup, after the Hive SDK initialization
After initializing the SDK, expose a UI to select game server. When the user selects a game server, use the API in the Configuration class and then display the Server Maintenance popup. - When game server or language is changed in game settings after user enters the game
You can provide a UI that allows user to change the game server or game language during game play – in the game settings, and so on. If user did change, use the API in the Configuration class for Hive settings as well. - When game data is changed in accordance with game planning
In case game information matched with Hive settings is changed except the cases above, make sure to use the API in the Configuration class.
If you change the value of zone field as real
by using the Configuration class and initialize the SDK even your configuration for the field in the .xml file is sandbox
, for instance, Hive runs based on the value of the API, real
. The value in the hive_config.xml file keeps its state as sandbox
.
The setZone
function operates normally when it is called before calling the setup
function.
Followings are sample codes to change zone field settings of users.
API Reference: hive.Configuration.setZone
1 2 3 4 5 |
using hive; Configuration.setZone(ZoneType.REAL); |
API Reference: hive::Configuration::setZone
1 2 3 4 5 6 7 |
#include <HIVE_SDK_Plugin/HIVE_CPP.h> using namespace std; using namespace hive; Configuration::setZone(ZoneType::REAL); |
API Reference: Configuration.setZone
1 2 3 4 5 |
import com.hive.Configuration Configuration.zone = Configuration.ZoneType.REAL |
API Reference: Configuration.setZone
1 2 3 4 5 |
import com.hive.Configuration; Configuration.INSTANCE.setZone(Configuration.ZoneType.REAL); |
API Reference: ConfigurationInterface.setZone
1 2 3 4 5 |
import HIVEService ConfigurationInterface.setZone(.real) |
API Reference: HIVEConfiguration:setZone
1 2 3 4 5 |
#import <HIVEService/HIVEService-Swift.h> [HIVEConfiguration setZone: HIVEZoneTypeReal]; |
Configure Hive Theme
Dark Theme is available by using hiveDark
. The default value is hiveLight
.
API Reference: hive.Configuration.setHiveTheme
1 2 3 4 5 6 |
using hive; Configuration.setHiveTheme(HiveThemeType.hiveLight); Configuration.setHiveTheme(HiveThemeType.hiveDark); |
API Reference: hive::Configuration::setHiveTheme
1 2 3 4 5 6 7 8 |
#include <HIVE_SDK_Plugin/HIVE_CPP.h> using namespace std; using namespace hive; Configuration::setHiveTheme(HiveThemeType::hiveLight); Configuration::setHiveTheme(HiveThemeType::hiveDark); |
API Reference: Configuration.setHiveTheme
1 2 3 4 5 6 |
import com.hive.Configuration Configuration.hiveTheme = HiveTheme.hiveLight Configuration.hiveTheme = HiveTheme.hiveDark |
API Reference: Configuration.setHiveTheme
1 2 3 4 5 6 |
import com.hive.Configuration; Configuration.INSTANCE.setHiveTheme(Configuration.HiveTheme.HiveLight); Configuration.INSTANCE.setHiveTheme(Configuration.HiveTheme.HiveDark); |
API Reference: HIVEConfiguration:setHiveTheme
1 2 3 4 5 6 |
import HIVEService ConfigurationInterface.setHiveTheme(.hiveLight) ConfigurationInterface.setHiveTheme(.hiveDark) |
API Reference: HIVEConfiguration:setHiveTheme
1 2 3 4 5 6 |
#import <HIVEService/HIVEService-Swift.h> [HIVEConfiguration setHiveTheme: HIVEThemeTypeHiveLight]; [HIVEConfiguration setHiveTheme: HIVEThemeTypeHiveDark]; |
Set the log type
Hive Log Type is able configured by using the Logger.setLogFilter API. LogType.Verbose among the six types as below is the default setting value:
- LogType.Verbose: Output logs during development
- LogType.Debug: Detail logs on all steps
- LogType.Info: Show Hive SDK process steps and result callback (recommended)
- LogType.Warning: Errors that affect nothing on running the game even in an unexpected situation
- LogType.Error: Errors that omit the setting information and affect running games
- LogType.None: No output of any log
- The log types are determined from the high level to the low as shown below and output the lower types than the logs you set.
- Verbose > Debug > Info > Waring > Error > None
- This setting is only valid when the
useLog
item of Configuration class is set astrue
.
1 2 3 4 |
>LogFilter logFilter = new LogFilter(); logFilter.coreLog = hive.LogType.Info; logFilter.serviceLog = hive.LogType.Info; hive.Logger.setLogFilter(logFilter); |
1 2 3 4 5 |
LogFilter logFilter = new LogFilter(); logFilter.coreLog = LogType::Info; logFilter.serviceLog = LogType::Info; Logger.setLogFilter(logFilter); |
1 2 3 4 5 6 7 |
// Declare LogFilter LogFilter logFilter = new LogFilter(); logFilter.coreLog = LogType.Info; logFilter.serviceLog = LogType.Info; // Setting LogFilter Logger.setLogFilter(logFilter); |
1 2 3 4 5 6 7 |
// Declare LogFilter val logFilter = LogFilter() logFilter.coreLog = LogType.Info logFilter.serviceLog = LogType.Info // Setting LogFilter Logger.logFilter = logFilter |
1 2 |
HIVELogFilter* logFilter = [[HIVELogFilter alloc]initWithCoreLog:HIVELogTypeInfo serviceLog:HIVELogTypeInfo]; [HIVELogger setLogFilter:logFilter]; |
1 2 |
let logFilter = LogFilter.init(coreLog:LogType.Info, serviceLog: LogType.Info) LogInterface.setLogFilter(logFilter) |
Items available to retrieve
The list of items that you can retrieve their values with Configuration
class methods are given below. You cannot set or modify their values but can retrieve them only.
Field | Description |
---|---|
hiveSDKVersion | The version of Hive SDK. |
referenceSDKVersion | The version of SDK which Hive SDK refers to. |
hiveCountry | The country code which Hive SDK server decides. |
Items available to configure
hive_config.xml file
The list of items that you can set or modify their values only with hive_config.xml file is given below.
Field | Description |
---|---|
providers | The collection of settings for third party libraries. |
The element, which belongs to providers , defines the settings about Facebook for verification with Authentication v4. When using Facebook SDK, if you need permissions other than To implement Facebook login When using Hive SDK v4 Unity Windows, it’s essential to add an |
|
The element, which belongs to providers, adds the settings about Google for verification with Authentication v4. To implement Google login on desktop, add the For implementing Google login on Steam Deck (Hive SDK v4 Unity Windows 22.0.0 or higher), include the |
|
The element, which belongs to providers, adds the settings about WeChat for verification with Authentication v4. | |
The element, which belongs to providers, adds the settings about QQ for verification with Authentication v4. | |
vk | The element, which belongs to providers, adds the settings about VK for verification with Authentication v4. |
line | The element, which belongs to providers, adds the settings about LINE for verification with Authentication v4. |
weverse | The element, which belongs to providers, adds the settings about Weverse for verification with Authentication v4. |
signinwithapple |
The element, which belongs to providers, adds the settings about Sign-in-with-Apple for verification with Authentication v4. (This item is used for signing in with the Apple account on Android and Windows.) (+4.15.6) To implement Sign-in-with-Apple login on Android and Windows, add the |
Adjust | An element of providers and it adds configurations for the market performance analytics tool Adjust. |
Singular | An element of providers and it adds configurations for the market performance analytics tool Singular. |
AppsFlyer | An element of providers and it adds configurations for the market performance analytics tool AppsFlyer. |
Firebase | An element of providers and it adds configurations for the market performance analytics tool Firebase Analytics. (+4.16.1) |
unsupportedUAShareType | Specifies the SNS not to be used when sharing game invitation messages and invitation links on social media. Applicable only to the Android platform. |
saveAnalyticsLogBeforeCrash |
This is an iOS-only feature that detects situations where the app is about to crash due to an The default setting value has been changed from |
hive_config.xml example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
<properties> <appId>com.sample.your</appId> <gameLanguage>en</gameLanguage> <!-- Server selection for the Hive platform. sandbox is for development, real is for commercial use (sandbox, real) --> <zone>real</zone> <!-- Setting whether to use SDK internal operation log (true, false) --> <useLog>false</useLog> <!-- Company Settings (C2S: Com2uS, GVI: Com2uS Holdings) --> <company>C2S</company> <!-- Channel settings (C2S: Hive platform) --> <channel>C2S</channel> <!-- Payment market settings (GO: Google Play, LE: Com2us Lebi, AP: Apple App Store) --> <market>GO</market> <!-- Set the HTTP Connect Timeout time used inside the Hive SDK in seconds. (No changes except in special cases) --> <httpConnectTimeout>8</httpConnectTimeout> <!-- Set the HTTP Read Timeout time used inside the Hive SDK in seconds. (No changes except in special cases) --> <httpReadTimeout>8</httpReadTimeout> <maxGameLogSize>50</maxGameLogSize> <universalLink>https://your.sample.com/</universalLink> <!-- Criteria for obtaining consent to the terms of service. (device, account) --> <agreementDetermineBase>device</agreementDetermineBase> <!-- (Android Only) Setting for unsupported SNS when sharing UA promotions on social media --> <!-- (Set only when excluding specific SNS from being displayed)--> <unsupportedUAShareType> <value>SMS</value> <value>URL</value> <value>KAKAO</value> <value>LINE</value> <value>WHATSAPP</value> <value>FACEBOOK</value> <value>MESSENGER</value> <value>WECHAT</value> </unsupportedUAShareType> <providers> <!-- The Facebook code below is an example of setting other permissions (e.g. user_friends, user_gender) in addition to the email permission and public_profile permission automatically set by the Hive SDK.--> <!-- When actually using hive_config.xml, only the permissions needed by the game company should be inserted as a <permission> element. --> <facebook id="1809615065921877"> <permissions> <permission name="user_friends" /> <permission name="user_gender" /> </permissions> </facebook> <google playAppId="123456789012" clientId="123456789012-abc.apps.googleusercontent.com" serverClientId="123456789012-abc.apps.googleusercontent.com" reversedClientId="com.googleusercontent.apps.123456789012-abc" deviceFlowClientId="331526026701-gn1abq1ev23nqj7rdvvlaamf7ii4f3u9.apps.googleusercontent.com" /> <googleplaygames playAppId="123456789012" clientId="123456789012-abc.apps.googleusercontent.com" serverClientId="123456789012-abc.apps.googleusercontent.com" reversedClientId="com.googleusercontent.apps.123456789012-abc" /> <qq id="1234567890" /> <vk id="1234567" /> <wechat id="wx12345cf6c789c0f1" secret="abcdefg" univeralLink="https://your.sample.com/"/> <line channelId="1234567890" /> <weverse clientId="abcdefg" /> <signinwithapple serviceid="com.sample.your" /> <!-- (Android Only) Set the service ID set in the Apple developer account to serviceid -–> <!-- User information tracking settings --> <Adjust name="Adjust" id="unused" key="1szd2kddtt3o" secretId="1" info1="1234567890" info2="123456789" info3="123456789" info4="123456789"> <events> <event name="Purchase" value="abc" /> <event name="TutorialComplete" value="def" /> <event name="Update" value="ghi" /> </events> </Adjust> <Singular name="Singular" id="your_sample_1234567f" key="abc"> <events> <event name="Purchase" value="purchase"/> <event name="TutorialComplete" value="tutorial Complete"/> <event name="Update" value="update"/> </events> </Singular> <AppsFlyer name="AppsFlyer" id="unused" key="abc" itunesConnectAppId="1234567890"> <events> <event name="TutorialComplete" value="Tutorial Complete" /> <event name="Update" value="Update" /> </events> </AppsFlyer> <Firebase name="Firebase" id="unused" key="unused"> <events> <event name="Purchase" value="purchase" /> <event name="TutorialComplete" value="tutorial_complete" /> <event name="Update" value="update" /> <event name="Open" value="open"/> </events> </Firebase> </providers> </properties> |
The hive_config.xml file and Configuration class method
The list of items that you can set or modify their values with Configuration
class methods and the hive_config.xml file are given below.
Field | Description |
---|---|
appId | The identifier of the game build. If this entry is not present, the app’s default package name is used on Android, and bundle ID on iOS. |
serverId | The identifier of each game server when the game is operated by separate servers by region. Make sure to be created according to the Hive Identifier Policy. |
zone | The type of server which Hive Client connects with.
|
useLog | Whether to activate the internal operation log of the Hive client. If you activated this, the log will be printed on the screen of your development tool.
|
company | Game publishing company.
|
channel | Login service platform that game app uses. C2S: Hive Platform (Default) |
market | Market to pay for the in-app purchase.
|
httpConnectTimeout | HTTP Connect timeout (second), which is used inner parts of Hive Client. The default value is 8 seconds, and it is not allowed to change unless unavoidable circumstances. |
httpReadTimeout | HTTP Read timeout (second), which is used inner parts of Hive Client. The default value is 8 seconds, and it is not allowed to change unless unavoidable circumstances. |
maxGameLogSize | The maximum queue size of game log, which stores unstructured data collected from Hive Analytics v2. Default size is 50, and it is not allowed to change unless unavoidable circumstances. |
gameLanguage | The game language set on the Hive SDK. |
ageGateU13 |
This is COPPA ageGateU13 applicability. To apply COPPA ageGateU13 in the Hive SDK, register the COPPA terms of service in the Hive console and set this value to true before initializing the Hive SDK. If you do not want to apply COPPA ageGateU13, register the terms of service other than the COPPA terms of service in the Hive console and set this value to false before initializing the Hive SDK.
|
agreementDetermineBase |
Determines the basis for obtaining consent to the terms of service. You can choose between device or account , with device being the default.
|
The Configuration class method
The list of items that you can set or modify their values only with the Configuration
class methods are given below.
Field | Description |
---|---|
analyticsSendLimit | The maximum amount of log to send in every log sending cycle. The default value is 5. |
analyticsQueueLimit | The maximum amount of log to queue. The default value is 50. |
analyticsSendCycle | Log sending cycle. Analytics log is sent in every setting cycle, available to set by second. The default value is 1 second. |
Deprecated Items
The list of deprecated items in hive_config.xml file is given below.
Field | Description | Notes |
---|---|---|
exitEventEnabled | exitEvent is an event that notifies you that the app needs to be terminated by the the game studio directly, not by the Hive SDK. Setting wether to receive an event sent by SDK when the game app should be closed. If this value is False, the Hive SDK can directly terminate the game app.(+v4.9.0) | deprecated since SDK 4.16.4 |
useCrashReport | As an iOS-only function, it detects the situation immediately before the app is forced to close (crash) due to an error and saves the Hive Analytics log that is waiting to be transmitted to server as a file. When using an external third-party crash reporter that provides a similar function, it must be disabled by setting it to false to prevent crashes. (+v4.16.0) | derpecated since v4.16.3 |
The list of deprecated items with Configuration
class methods is given below.
Field | Description | Notes |
---|---|---|
permissions | Whether to ask the user to accept the permissions by type. Android only.
|
derpecated from SDK v4.16.3 |
hivePermissionViewOn | Setting whether to display Hive SDK permission notice popup
|
derpecated since v4.16.2 |