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.

File save path
  • iOS: <Project_route>/Assets/Plugins/iOS/
  • Android
         –   Unity 2021 and higher: <Project_route>/Assets/HiveSDK/hive.androidlib/src/main/res/raw
         –   Prior to Unity 2021: <Project_route>/Assets/Plugins/Android/res/raw/
  • 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.

      • The example UI of setting a game server
      • The example UI of setting a game language
    • 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.

    Unity®

    API Reference: hive.Configuration.setZone

    C++

    API Reference: hive::Configuration::setZone

    Android

    API Reference: Configuration.setZone

    iOS

    API Reference: HIVEConfiguration:setZone

     

    Configure Hive Theme

    Dark Theme is available by using hiveDark. The default value is hiveLight.

    Unity®

    API Reference: hive.Configuration.setHiveTheme

    C++

    API Reference: hive::Configuration::setHiveTheme

    Android

    API Reference: Configuration.setHiveTheme

    iOS

    API Reference: HIVEConfiguration:setHiveTheme

    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 as true.
    Unity®

    C++

    Java

    Kotlin

    Objective-C

    Swift

     

    Items available to configure

    Item Information

    Items highlighted in blue are available to manage in the configuration file. Functions are also provided for some items to use as methods in the Configuration class.

    Item Description Function
    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. get
    set
    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. get
    set
    zone The type of server which Hive Client connects with.

    • real: Production server
    • sandbox: Test server
    get
    set
    useLog Whether to activate the internal operation log of the Hive client.

    • true: Log activated
    • false: Log deactivated
    get
    set
    ageGateU13 Whether to activate COPPA with Hive SDK.

    • true: COPPA ageGateU13 activated
    • false: COPPA ageGateU13 deactivated
    get
    set
    permissions Whether to ask the user to accept the permissions by type. Android only.

    Permission type Tag name
    Access permission to external memory.

    • <sdwrite>true</sdwrite> : Display a permission request popup
    • <sdwrite>false</sdwrite> : Not display a permission request popup
    sdwrite
    get
    set
    company Game publishing company.

    • C2S: Games by Com2uS
    • GVI: Games by Com2uS Holdings
    get
    set
    companyIndex Game publishing company indicated by index. The registered companyIndex is received through a communication with provisioning server, and sent to analytics log. Game studios have nothing to configure.
    channel Login service platform that game app uses.

    • HIVE: Hive Platform (Default)
    get
    market Market to pay for the in-app purchase.

    • GO: Google Play Store
    • LE: Com2uS Lebi
    • AP: Apple App Store
    get
    httpConnectTimeout HTTP Connect timeout (second), which is used inner parts of Hive Client. Default value is 10 seconds, and it is not allowed to change unless unavoidable circumstances. get
    set
    httpReadTimeout HTTP Read timeout (second), which is used inner parts of Hive Client. Default value is 15 seconds, and it is not allowed to change unless unavoidable circumstances. get
    set
    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. get
    set
    providers The collection of settings for third party libraries.
    facebook The element, which belongs to <providers>, defines the settings about Facebook for verification with Authentication v4. (+4.14.0)
    google The element, which belongs to <providers>, adds the settings about Google for verification with Authentication v4. (+4.14.0)
    wechat The element, which belongs to <providers>, adds the settings about WeChat for verification with Authentication v4. (+4.14.0)
    qq The element, which belongs to <providers>, adds the settings about QQ for verification with Authentication v4. (+4.14.0)
    vk The element, which belongs to <providers>, adds the settings about VK for verification with Authentication v4. (+4.14.0)
    line The element, which belongs to <providers>, adds the settings about LINE for verification with Authentication v4. (+4.14.0)
    weverse The element, which belongs to <providers>, adds the settings about Weverse for verification with Authentication v4. (+4.15.2)
    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.) (+4.15.6)
    Adjust The element, which belongs to <providers>, adds the settings about Adjust for verification with Authentication v4. (+4.14.0)
    Singular The element, which belongs to <providers>, adds the settings about Singular for verification with Authentication v4. (+4.14.0)
    AppsFlyer The element, which belongs to <providers>, adds the settings about AppsFlyer for verification with Authentication v4. (+4.14.0)
    trackers The collection of settings for third party attributions. (deprecated with SDK 4.14.0 and later)
    tracker The element, which belongs to <trackers>, defines the settings about one of Third Party Attribution. (deprecated with SDK 4.14.0 and later)
    qqAppId QQ AppID to sign in QQ in the game with Authentication v4 (+v4.5.0). (deprecated with SDK 4.14.0 and later)
    vkAppId VK AppID to sign in VK in the game with Authentication v4 (+v4.6.0). (deprecated with SDK 4.14.0 and later)
    wechatAppId WeChat AppID to sign in VK in the game with Authentication v4 (+v4.6.0). (deprecated with SDK 4.14.0 and later)
    echatAppSecret The value of WeChat App Secret to sign in WeChat in the game with Authentication v4 (+v4.6.0). (deprecated with SDK 4.14.0 and later)
    wechatPaymentKey The value of WeChat Payment Key which is used to pay on WeChat (+v4.7.0). (deprecated with SDK 4.14.0 and later)
    facebookPermissions Additional permissions required for Facebook Login (+v4.9.0, 4.5.4, 4.6.3, 4.7.2, 4.8.1).
    Adding no key (facebookPermissions):

  • Auth v1: public_profile, email, user_friends
  • Auth v4: public_profile, email
  • Adding key without value:

  • Auth v1: public_profile, email
  • Auth v4: public_profile, email
  • Adding both key and value:

  • Auth v1: public_profile, email, additional permissions
  • Auth v4: public_profile, email, additional permissions
  • (deprecated with SDK 4.14.0 and later)

    exitEventEnabled Setting wether to receive an event sent by SDK when the game app should be closed (+v4.9.0).
    analyticsSendLimit The maximum amount of log to send in every log sending cycle. Default is 5 (+v4.11.0). get
    set
    analyticsQueueLimit The maximum amount of log to queue. Default is 50 (+v4.11.0). get
    set
    analyticsSendCycle Log sending cycle.
    Analytics log is sent in every setting cycle, available to set by second. Default is one second (+v4.11.0).
    get
    set
    useCrashReport The value to guarantee the operation of third-party crash reporter.
    If you run the third-party crash reporter, set as false. iOS only (+v4.11.0).
    googleClientId The value of iOS – Google Client ID required for Google sign-in on iOS (Auth v1: v4.5.0+, Auth v4: v4.11.0+). (deprecated with SDK 4.14.0 and later)
    googleServerClientId The client ID of web application required for Google Play sign-in on Authentication v4-based games (Android: v4.5.0+, iOS: v4.11.0+). (deprecated with SDK 4.14.0 and later)
    hiveSDKVersion The version of Hive SDK. get
    referenceSDKVersion The version of SDK which Hive SDK refers to. get
    gameLanguage The game language set on the Hive SDK. set
    hiveCountry The country code which Hive SDK server decides. get
    hivePermissionViewOn Setting whether to display Hive SDK permission notice popup (+4.12.1).

    • true: Display the popup
    • false: Do not display the popup
    set

    Example of hive_config.xml