Unity
There are two ways to configure hive_config.xml in the Unity environment.
- Automatically configure the contents of hive_config.xml with Unity Hive Config Editor
- Manually configure hive_config.xml
1. automatic configuration with Unity hive config editor¶
In the Unity environment, you can automatically create the hive_config.xml file and configure most of its contents using the Unity Hive Config Editor. However, even when using the Unity Hive Config Editor, some values in the hive_config.xml file must be set manually.
Note
When developing Android apps, it is convenient not to have to configure AndroidManifest.xml directly, so using the Unity Hive Config Editor is recommended.
Running Unity hive config editor¶
Select Hive > Hive Config (Edit Config) and set the necessary values on the Editor screen.
Select execution environment¶
First, select the app execution environment (Android, iOS, macOS, Windows).
Common (common features of hive sdk)¶
Common tab allows you to configure settings that apply to all features of the Hive SDK. You can set the Hive AppID and choose the server (production or sandbox). You can also determine the screen orientation to be displayed when the app is launched. All settings in the Common tab are required to be filled out.
Field | Description | Value Range |
---|---|---|
Hive App Id | AppID registered in the Hive console app center | (e.g., com.sample.your ) |
Zone | Hive server | * Sandbox * Real |
Logging | Whether to enable logging of internal operations of Hive SDK | * On * Off |
AgeGateU13 | Whether to apply COPPA ageGateU13 | * Off * On |
Hive Orientation | UI of Hive SDK displayed according to device orientation settings | * All * Portrait * Landscape * Undefined |
Channel | Login and in-app support service platform used in the game app | * C2S (Hive platform) * KAK (Kakao) * LIN (Line) * STE (Steam) * EPI (Epic Store) * FAS (FastSprint) |
Market | Market for in-app purchase payments (for analytics collection) | * GO (Google PlayStore) * AP (Apple AppStore) * ON (OneStore) * AM (Amazon AppStore) * LE (Com2us Lebi) * HS (Hive Store) * GA (Samsung GalaxyStore) * HU (Huawei AppGallery) |
Universal Link | Universal Link for iOS deferred deep link settings | Domain specified by the app developer (e.g., https://yourdomain.com ) |
Auth (authentication)¶
Auth tab is where you configure settings to use the Hive SDK authentication feature. The Hive SDK supports IdP logins such as Facebook, Google, and QQ. After selecting the IdP to be used for login, you need to retrieve and enter the AppId
, ClientId
, etc., from the developer console of this IdP (for example: Google console).
For example, to use Google SignIn, you need to obtain the required values for the Google SignIn item from the Google Console and enter them in the Auth tab as shown below.
- Google App Id: Enter the AppID issued from the Google console
- Google Server Client ID: Enter the Client ID value of the web application issued from the Google console
Note
For detailed information on each authentication IdP configuration value, please refer to the Authentication Preparation Page.
Market (billing)¶
Market tab is where you configure the settings to use the Hive SDK billing feature. Hive SDK supports app markets such as Google Play Store and Apple App Store, and in this tab, you need to set the values required for in-app purchases.
For example, if the app supports Android Lebi market and Wechat Pay payments, you need to enter the Payment Key issued from the Wechat console in the market tab.
Field | Description | Value Range |
---|---|---|
Wechat Payment Key | When using Wechat as a charging method for Lebi market on Android Set the Payment Key for Wechat | (Example: abcDEF1234xYz789) |
Analytics (marketing attribution)¶
Analytics tab is where you configure the settings to use the Hive SDK marketing attribution feature. The Hive SDK supports marketing attribution through Adjust, Firebase, etc., and you need to obtain the key
and event
values from the respective service developer console and enter them in this tab.
For example, to use Adjust, enter the required values for the Adjust item in the Analytics tab according to the information below.
- appToken: Enter the AppToken issued from the Adjust console
- Event: Enter the Name and Value of the event registered in the Adjust console
Note
For more details on each marketing attribution setting, please refer to the Marketing Attribution Preparation Page.
Optional (network communication options, logging, and other features)¶
Optional In the tab, you can enter network communication options, logs, and other settings when using the Hive SDK.
For example, if you want to extend the network timeout when calling a Hive SDK method, increase the values of httpConnectTimeout
and httpReadTimeout
. As another example, when sending remote logs, you can change the transmission cycle and the size of the transmitted log data, which allows you to modify the analytics log setting values. It is recommended to use the default values for optional tab items unless absolutely necessary.
Field | Description | Value Range |
---|---|---|
Unsupported UA Share Type | Type of social media to be used in the Hive sharing UI when using Android UA Share feature | * SMS * URL * KAKAO * LINE * MESSENGER |
agreementDetermineBase | Criteria for determining agreement to terms | * device * account |
httpConnectTimeout | Set the Connect timeout duration (in seconds) during Hive protocol communication (default value recommended) | * 8 (default) |
httpReadTimeout | Set the Read timeout duration (in seconds) during Hive protocol communication (default value recommended) | * 8 (default) |
maxGameLogSize | Maximum number of game logs stored as unstructured data files | |
analyticsSendLimit | Maximum amount of logs to send per log transmission cycle | |
analyticsQueueLimit | Maximum amount of logs that can be queued | |
analyticsSendCycle | Log transmission cycle | |
saveAnalytisLogBeforeCrash | iOS-specific setting to determine whether to save pending analytics logs to a file instead of sending them to the server when the app is about to crash due to a NSException type error or Unix signal type error |
Save settings and create hive_config.xml file¶
After completing all tab settings in the Unity Hive Config Editor, clicking Save & Regenerate setting files will automatically generate the hive_config.xml file.
Android¶
Clicking on Save & Regenerate setting files will create the AndroidManifest.xml file and the hive_config.xml file. The location where the hive_config.xml file is created varies depending on the version of Unity.
- Unity 2021 and above:
/Assets/HiveSDK/hive.androidlib/src/main/res/raw/hive_config.xml - Unity below 2021:
/Assets/Plugins/Android/res/raw/hive_config.xml
iOS¶
Clicking Save & Regenerate setting files will create the Info.plist file and the hive_config.xml file. The hive_config.xml file will be created at the location below.
/Assets/Plugins/iOS/hive_config.xml
Windows¶
Pressing the Windows button will create the hive_config.xml file. The hive_config.xml file will be created in the location below.
/Assets/Plugins/Windows/res/hive_config.xml
2. manual configuration¶
If you do not use the Unity Hive Config Editor, you will need to create the hive_config.xml file and manually set most of the values in the file.
hive_config.xml file creation¶
Create the hive_config.xml file directly at the path below.
- Android
- Unity 2021 or later:
/Assets/HiveSDK/hive.androidlib/src/main/res/raw/hive_config.xml - Unity prior to 2021:
/Assets/Plugins/Android/res/raw/hive_config.xml
- Unity 2021 or later:
- iOS
/Assets/Plugins/iOS/hive_config.xml
- Windows
/Assets/Plugins/Windows/res/hive_config.xml
hive_config.xml modification¶
Refer to Next to directly modify and save the hive_config.xml file. However, some values in the file are set according to the needs of the developer.
hive_config.xml file example¶
Below is an example of the hive_config.xml file when using authentication (Google authentication) and payment (Google Play Store or Apple AppStore). Please modify, add, or delete values according to the Hive SDK features you want to use and the app environment. Since iOS only supports Apple AppStore payments, set the market to AP
in the Unity iOS environment.
<properties>
<!-- Hive SDK common settings: START -->
<!-- Set game build unique identifier -->
<appId>com.sample.your</appId>
<!-- Select server for Hive platform. sandbox is for development, real is for commercial
(sandbox, real) -->
<zone>real</zone>
<!-- Set whether to use SDK internal operation logs
(true, false) -->
<useLog>false</useLog>
<!-- Set whether to apply ageGateU13
(true, false) -->
<ageGateU13>false</ageGateU13>
<!-- Hive Orientation setting -->
<hiveOrientation>landscape</hiveOrientation>
<!-- Channel setting (login and in-app support service platform)
(C2S: Hive platform) -->
<channel>C2S</channel>
<!-- Payment market setting (GO: Google Play, LE: Com2us Lebi, AP: Apple App Store) -->
<market>GO</market>
<!-- Set standard for receiving terms agreement
(device, account) -->
<agreementDetermineBase>false</agreementDetermineBase>
<!-- Terms exposure design setting (Not set for SDK v4)
(true, false) -->
<!-- <authV1Agreement>device</authV1Agreement> -->
<!-- Set sharing apps to not expose when sharing promotion UA (Android Only) -->
<unsupportedUAShareType>
<value>SMS</value>
<value>URL</value>
</unsupportedUAShareType>
<!-- Set HTTP Connect Timeout time in seconds used internally by Hive SDK
(Do not change unless it is a special case) -->
<httpConnectTimeout>8</httpConnectTimeout>
<!-- Set HTTP Read Timeout time in seconds used internally by Hive SDK
(Do not change unless it is a special case) -->
<httpReadTimeout>8</httpReadTimeout>
<!-- Hive SDK common settings: END -->
<!-- Hive SDK analytics settings: START -->
<!-- Analytics settings, refer to analytics pre-configuration guide -->
<!-- Hive SDK analytics settings: END -->
<!-- Hive SDK feature settings: START -->
<providers>
<!-- Set authentication product, refer to authentication pre-configuration guide -->
<!-- Set billing product, refer to billing pre-configuration guide -->
<!-- Set marketing attribution product, refer to marketing attribution pre-configuration guide -->
</providers>
<!-- Hive SDK feature settings: END -->
</properties>
Info
The Hive SDK configuration can save values in the configuration file before app build or change the settings during runtime (app execution). For more details, please check Hive SDK configuration.