Unity
There are two ways to configure hive_config.xml in the Unity environment.
- Automatically set the contents of hive_config.xml using Unity Hive Config Editor
- Manually set hive_config.xml
1. Automatic configuration with Unity hive config editor¶
In the Unity environment, you can automatically generate 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 in the Editor screen.
Select execution environment¶
First, select the app execution environment (Android, iOS, macOS, Windows).
Common (common features of hive sdk)¶
Common tab is where you 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 | (Example: com.sample.your ) |
Zone | Hive server | * Sandbox * Real |
Logging | Whether to enable logs for Hive SDK internal operations | * On * Off |
AgeGate | Whether to apply COPPA ageGateU13 | * Off * On |
Hive Orientation | Screen rotation direction to be used in the app | * All * Portrait * Landscape * Undefined |
Universal Link | iOS deferred deep link setup |
Auth (authentication)¶
Auth tab is where you configure settings to use the Hive SDK authentication feature. Hive SDK supports IdP logins such as Facebook, Google, QQ, etc. 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 (e.g., Google console).
For example, to use Google SignIn, you need to retrieve 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 more details 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 Lebi market payment method on Android Set the Payment Key for Wechat | (Example: abcDEF1234xYz789) |
Analytics (marketing attribution)¶
Analytics tab allows you to configure 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
. Another example is when changing the transmission cycle and the size of the transmitted log data during remote log transmission, you can 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 |
httpConnectTimeout | Set the Connect timeout duration (seconds) during Hive protocol communication (recommended to use default) | * 8 (default) |
httpReadTimeout | Set the Read timeout duration (seconds) during Hive protocol communication (recommended to use default) | * 8 (default) |
maxGameLogSize | Configuration value for Hive SDK analytics feature | |
analyticsSendLimit | Configuration value for Hive SDK analytics feature | |
analyticsQueueLimit | Configuration value for Hive SDK analytics feature | |
analyticsSendCycle | Configuration value for Hive SDK analytics feature | |
saveAnalytisLogBeforeCrash | Configuration value for Hive SDK analytics feature |
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 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 Unity version.
- 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¶
Windows button will create the hive_config.xml file. The hive_config.xml file will be created at the location below.
/Assets/Plugins/Windows/res/hive_config.xml
hive_config.xml manual configuration¶
Even when using the Unity Hive Config Editor, some of the values below in the hive_config.xml file must be set manually.
Field | Description | Value Range |
---|---|---|
Company | App publishing company | Example: If it's Com2us, C2S |
Channel | Login service platform used by the app | Hive (default) |
Market | App market where the app will be released | * Android: GO (Google), LE (Lebi)* iOS: AP (App Store) |
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 before 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 and modify the hive_config.xml file directly, then save it. However, some values in the file are set according to the developer's needs.
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.
``` xml
<!-- Hive SDK common: START -->
<appId>com.sample.your</appId>
<gameLanguage>en</gameLanguage>
<!-- Select Hive platform's server. sandbox for development, real for live
(sandbox, real) -->
<zone>real</zone>
<!-- Set whether to use internal SDK operation logs
(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 HTTP Connect Timeout duration used internally in the Hive SDK in seconds
(do not change unless in special cases) -->
<httpConnectTimeout>8</httpConnectTimeout>
<!-- Set HTTP Read Timeout duration used internally in the Hive SDK in seconds
(do not change unless in special cases) -->
<httpReadTimeout>8</httpReadTimeout>
<agreementDetermineBase>device</agreementDetermineBase>
<!-- Hive SDK common settings: END -->
<!-- Hive SDK feature-specific settings: START -->
<!-- Authentication product settings: Use Google authentication -->
<providers>
<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" />
</providers>
<!-- Hive SDK feature-specific settings: END -->
Info
The Hive SDK settings can either store values in the configuration file before the app build or change the settings during runtime (app execution). For more details, check the Hive SDK settings.