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

    Kotlin

    API Reference: Configuration.setZone

    Java

    API Reference: Configuration.setZone

    Swift

    API Reference: ConfigurationInterface.setZone

    Objective-C

    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

    Kotlin

    API Reference: Configuration.setHiveTheme

    Java

    API Reference: Configuration.setHiveTheme

    Swift

    API Reference: HIVEConfiguration:setHiveTheme

    Objective-C

    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 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.
    facebook

    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 email (access to the email address of a Facebook account) and public_profile (access to–– the public profile of a Facebook account) which are automatically set by Hive SDK, select the permissions on the Facebook console and add them as elements in the hive_config.xml file.

    To implement Facebook login When using Hive SDK v4 Unity Windows, it’s essential to add an id attribute within this element, specifying your AppID as its value. You can find your AppID in the Meta app dashboard after your app has been created.

    google

    The element, which belongs to providers, adds the settings about Google for verification with Authentication v4.

    To implement Google login on desktop, add the clientId attribute within this element, setting it to the Client ID obtained from the Google Cloud Console.

    For implementing Google login on Steam Deck (Hive SDK v4 Unity Windows 22.0.0 or higher), include the deviceFlowClientId attribute within this element, specifying the Client ID issued by the Google Cloud Console as its value.

    wechat The element, which belongs to providers, adds the settings about WeChat for verification with Authentication v4.
    qq 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 serviceid attribute within this element, and specify the Services ID you received from the Apple Developer Center as its value.

    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 NSException type error or a Unix signal type error, and saves the pending Hive analytics logs to a file without sending them to the server. If you are using an external third-party crash reporter, you must set this to false to prevent conflicts. The useCrashReport value used in versions below 4.16.3 has been replaced with saveAnalyticsLogBeforeCrash (+v4.16.3).

    The default setting value has been changed from true to false (+v4.24.2.0).

    hive_config.xml example

    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.

    • real: Production server
    • sandbox: Test server
    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.

    • true: Log activated
    • false: Log deactivated
    company Game publishing company.

    • C2S: Games by Com2uS
    • GVI: Games by Com2uS Holdings
    channel Login service platform that game app uses. C2S: Hive Platform (Default)
    market Market to pay for the in-app purchase.

    • GO: Google Play Store
    • LE: Com2uS Lebi
    • AP: Apple App Store
    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.

    • true: Applies COPPA ageGateU13 for the Hive SDK.
    • false: Does not apply COPPA ageGateU13 for 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.

    • device: Displays the terms of service consent popup during the initialization stage, the execution of AuthV4.setup(), and obtains consent based on the device, once per device. Once consent is obtained on a device, users logging in with different accounts on the same device will not be prompted for consent again. You can erase the records of consent with resetAgreement().
    • account: Displays the terms of service consent popup during login and obtains consent once per PlayerId. Can only be used when COPPA ageGateU13 is not applied. You cannot erase the records of consent with resetAgreement(). Marketing tracking tools will operate after obtaining consent.

    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.

    • Access permission to external memory.
      • true: Display a permission request popup
      • false : Not display a permission request popup
    • Tag name: sdwrite
    derpecated from SDK v4.16.3
    hivePermissionViewOn Setting whether to display Hive SDK permission notice popup

    • true: Display the popup
    • false: Do not display the popup
    derpecated since v4.16.2