To use Hive functions in the game, you must initialize Hive SDK. After initialization, Terms of Service as well as update and notice popups registered on Hive console are automatically exposed.

Initialization Process Details

When Hive SDK is initialized, it performs the following functions:

  • Hive SDK initializes the following items with one initialization function.
    • Authentication: Initializes Hive Client and authenticates user IdP
    • Promotion: Does advertisement and issues coupons
    • Notification: Manages and sets push messages to users
    • Marketing Attribution: Supports total management of third-party module which traces user data, such as the number of players through advertisement and event analysis
  • Hive SDK does not directly notify app access permissions. For more information, please check FAQ.
  • Expose the update and notice popups set for the relevant game. For the Google Play store, the in-app update is supported. For more details of registering update popups, see Hive console guide.
  • Check the user IP and expose Terms of Service by country.

In-app Update

The in-app update is the feature that following the update popup configuration updates the app on the background without terminating the app. The in-app update can be used under the following conditions.

  • Only the Google Play Store is supported.
  • Supports only Android mobile, Android tablet, and ChromeOS devices.
  • Supports both app file formats: AAB (Android App Bundle) and APK. However, APK expansion files (.obb files) are not supported.
  • For AAB, up to 200MB is supported, and For APK, up to 150MB is supported in size.
  • Hive Initialization Diagram

Register Hive Certification Key

With the Configuration class API, register the Hive certification key issued on the Hive console page before the Hive initialization. The corresponding API is provided from version 4.15.0 or higher.

Unity®

API Reference: Unity®

C++

API Reference: C++

Kotlin

API Reference: Kotlin

Java

API Reference: Java

Swift

API Reference: Swift

Objective-C

API Reference: Objective-C

Implement Initialization

To initialize Hive SDK, implement setup() method in the AuthV4 class. Following data is delivered as a result, so you can save the data in the game and utilize it if needed.

  • The Result Data of Hive Initialization
Field Name Description Example
isAutoSignIn Whether automatic login is available or not true
did The did is the identifier of an app instance that is created in the app installation. It is used to identify an app instance of the same app. 123456789
providerTypeList Available IdP list for the current app
It is essential field to use when customizing explicit login or composing the information of IdP sync status.
ProviderType.FACEBOOK
ProviderType.HIVE

Followings are sample codes to implement setup() method.

Unity®

API Reference: hive.AuthV4.setup

C++

API Reference: AuthV4::setup

Kotlin

API Reference: com.hive.AuthV4.setup

Java

API Reference: com.hive.AuthV4.setup

Swift

API Reference: HIVEAuthV4:setup

Obj-C

API Reference: HIVEAuthV4:setup

Server Maintenance Popups

For the game service, it is necessary to block the version after the update of the game client, or to block the game connection during the maintenance of the game server. Hive provides the functions to expose popups in the order of Forced game update, notification/server maintenance in accordance with the information configured in Hive Console. In the game, you can use the UI provided by Hive SDK or implement the customized UI by receiving the information from Hive.

Game Update by Force Block to use the specific version of games and provide a link for update
Server Maintenance Available to set the maintenance status by game server, and recommended to provide official community links by game during the server maintenance
Notice Use to expose the important notice or update information not by force to all users

If game server is more than one, the game server information selected or set by the user must be set in Hive. If the user needs to select a game server, implement the server selection UI to change the Hive setting by calling setServerId() method of the Configuration class before showing various types of popup. If you want to renew promotion-news data with changing Hive setting, call Configuration class updateServerId() method instead of setServerId() method.

After the game server is set up, you can expose a popup at any time. If you set a popup on Hive Console, it will block game access during maintenance time. Displaying popups are available to use the UI provided by Hive SDK or customize it based on the information from Hive. Server maintenance popup/update popup/notice popup are available to set for each game server.

Setting Popup Contents

Set the details of server maintenance popup/update popup/notice popup on Hive Console. For more information about settings, see Operation > Provisioning guide.

Displaying Popup

Hive displays maintenance popup/update popup/notice popup, or returns information of the popup messages for customizing the popup. If Hive displays it, the popup will appear in the Hive UI style, but if you want to do it yourself, you can display the popup in whatever style you want. Call the checkMaintenance() method in the AuthV4 class by setting the parameters as shown below depending on whether you are using Hive popups.

  • A use of Hive-providing popups: Set isShow parameter as true.
  • A request for popup data to customize popups: Set isShow parameter as false. For more information about popup data, see Popup Data Returned by Hive below.
  • Example screen of popup

The following is an example code that displays a server maintenance popup with the UI provided by the Hive. If a user closes this popup when the server maintenance has not been completed, the exit event will be fired and forwarded to ResultAPI result.

Unity®

API Reference: Unity®

C++

API Reference: C++

Kotlin

API Reference: Kotlin

Java

API Reference: Java

Swift

API Reference: Swift

Objective-C

API Reference: Objective-C

Popup Data Returned by Hive

If Hive receives request for the popup information set in Hive Console through the checkMaintenance() method, it returns the values summarized in the following table in the AuthV4MaintenanceInfo object, and if this value is returned as null, there is no content to pop up.

  • Details of AuthV4MaintenanceInfo object
    Field Name Description Type
    title Popup title String
    message Popup contents String
    button Text for the label of popup button String
    action Action type when a user taps the popup button

    • OPEN_URL: Execute URL passed by external browser
    • EXIT: End the app
    • DONE: Just close maintenance popup
    Enumeration type of AuthV4MaintenanceActionType
    url URL displayed by external browser. This is valid when the value of action field is OPEN_URL String
    remainingTime Remaining time until maintenance completion (Unit: second). Time refreshes in real time and when it becomes zero, app is terminated. Integer
    startDate the start date of the maintenance String
    endDate the end date of the maintenance String
    customerButton the button text of the customer center (the maintenance popup sends "") String
    customerLink the button link of the customer center (the maintenance popup sends "") String
    exButtons the popup button information (3 items are delivered at maximum) JSONArray
    exButtons.action the action when the popup button was clicked

    • OPEN_URL: Execute URL passed by external browser
    • EXIT: End the app
    • DONE: Just close maintenance popup
    Enumeration type of AuthV4MaintenanceActionType
    exButtons.button the label text of the popup button String
    exButtons.url the URL passed to the external browser.
    action
    available only if the field value is OPEN_URL
    String

Hive WebView

Terms of Service

At the time of initialization, Hive SDK expose Terms of Service (“Terms”) that are appropriate for the country determined by the user’s access IP and game development company automatically. Even so, the game should provide links for Terms and Privacy Policy to all users regardless of consent to Terms and Privacy Policy. If you use the link provided by Hive, the proper Terms and Policy are automatically selected to expose to users depending on the setting on Hive Console. The regulations how to indicate a link of Terms and Policy are different by game development company.

  • Example screen of terms

To display Terms of Service when click the button or link, call showTerms() method of AuthV4 class. Followings are sample codes.

Unity®

API Reference: Unity®

C++

API Reference: C++

Kotlin

API Reference: Kotlin

Java

API Reference: Java

Swift

API Reference: Swift

Objective-C

API Reference: Objective-C

 

Remove the agreement history of Terms & Conditions

Once a game user agrees to the terms and conditions when running the game for the first time, the record of agreement to the terms and conditions remains on the device. The resetAgreement method below deletes this history.

Unity®

C++

Kotlin

Java

Swift

Obj-C

Hive Profile

To display the Hive profile screen, call showProfile() of the AuthV4 class. When the profile screen is displayed, users can check and change their profile image and nickname.

 

Below is an example code for displaying the Hive profile.

Unity®

API Reference: AuthV4.showProfile

C++

API Reference: AuthV4::showProfile

Kotlin

API Reference: AuthV4.showProfile

Java

API Reference: AuthV4.INSTANCE.showProfile

Swift

API Reference: AuthV4Interface.showProfile

Objective-C

API Reference: [HIVEAuthV4 showProfile]

 

If you provide Hive Membership IdP, Hive Membership offers password change and membership withdrawal in Hive Account Settings on the Hive profile screen, so you must implement showProfile().

Profile when Hive Membership IdP was integrated
Profile when the IdPs (including guest) other than Hive Membership were integrated

 

Even if you provide other IdPs only and not Hive Membership IdP, displaying the profile screen allows you to offer security features such as blocking foreign logins, logging out of all devices, and checking login history. Therefore, it’s recommended to implement showProfile() to display the profile screen. If integrated with IdPs like Facebook that return profile images and nicknames, the provided image and nickname from that IdP will automatically be set for the profile screen.

Inquiry

As a customer service system for Hive Platform users, it provides FAQ and inquiry for each games. This function is available on games, Hive website as well as Hive mobile web. Expose CS Code (PlayerID) with a button to access Hive Customer Service, which helps users post questions about games.

  • An example screen of Inquiry

To expose the inquiry page, call showInquiry() method in the AuthV4 class.
Followings are sample codes to display the inquiry page.

Unity®

API Reference: AuthV4 .showInquiry

C++

API Reference: AuthV4 ::showInquiry

Kotlin

API Reference: AuthV4.showInquiry

Java

API Reference: AuthV4 .INSTANCE.showInquiry

Swift

API Reference: AuthV4Interface .showInquiry

Objective-C

API Reference: [ HIVEAuthV4 showInquiry]

My Inquiry Shortcut

The users synced with Hive membership can check their inquiry history via My Inquiry shortcut. Call showMyInquiry() method in AuthV4 class to make users inquire about your game and solve it easily. If user has inquired via Hive mobile or website, however, the inquiries are not exposed even Hive ID and CS Code(PlayerID) are specified on it, because it’s unknown whether user logged-in Hive membership or not.

Followings are sample codes to expose My Inquiry shortcut.

Unity®

API Reference: hive.AuthV4 .showMyInquiry

C++

API Reference: AuthV4:: showMyInquiry

Kotlin

API Reference: AuthV4.showMyInquiry

Java

API Reference: com.hive .AuthV4.showMyInquiry

Swift

API Reference: AuthV4Interface .showMyInquiry

Objective-C

API Reference: HIVEAuthV4:: showMyInquiry

Hive Chatbot CS
Inquiry via Chatbot
  • An example screen of inquiry for chatbot

To expose the chatbot page, call showChatbotInquiry() method in the AuthV4 class.

Argument Type Description
additionalInfo string Data to send when exposing chatbot page
Fixed as "{ \"init_path\":\"hive_sdk_api\" }" and if additional values are required, contact Leading Development Team, Com2uS Platform

Followings are sample codes to display the inquiry via chatbot page.

Unity®

API Reference: hive .AuthV4.showChatbotInquiry

C++

API Reference: AuthV4 ::showChatbotInquiry

Kotlin

API Reference: AuthV4.showChatbotInquiry

Java

API Reference: com.hive .AuthV4.showChatbotInquiry

Swift

API Reference: AuthV4Interface.showChatbotInquiry

Objective-C

API Reference: HIVEAuthV4:: showChatbotInquiry

Chatbot Settings

AppDelegate in chatbot defines common actions (methods) of the object at the top in iOS app. When building your project with Xcode, it generates the class automatically.

Hive SDK exposes chatbot UI in portrait only for user convenience. Running this feature on iOS requires screen-orientation-related function, application(_:supportedInterfaceOrientationsFor:) method in the AppDelegate class of the game engine. This method returns UIInterfaceOrientationMask value for using on the game. It returns landscape in landscape-only game, portrait in portrait-only game, and landscape as well as portrait in all-type-supported game.


Objective-c

Swift

Chatbot only in portrait on iPad is required to build your Xcode project with the additional settings below.

Showing Community Page

For the automatic login processing and the normal operation of the community, expose the community site through the API call as shown below. When setting up Community sites that follow the Hive regulations, if you want to use a custom domain address other than withhive.com and com2us.com, register the domain address to Hive console whitelist and then call this API.

For the automatic login and other functions in the Hive community, expose the community page through the API call as below.

Unity®

API Reference: SocialV4 .showCommunity

C++

API Reference: SocialV4 .showCommunity

Kotlin

API Reference: SocialV4.showCommunity

Java

API Reference: SocialV4.INSTANCE .showCommunity

Swift

API Reference: SocialV4Interface.showCommunity

Objective-C

API Reference: HIVESocialV4 showCommunity

Implementing Remote Logging

Remote logging is a feature that allows you to check logs for debugging published apps remotely by sending debugging logs from client to Hive server. To implement this function, register on Hive Console. This feature activates the remote log of target users only. For more details how to register, refer to the operation guide in Operation > Provisioning > Remote logging.

  • Activation
    If you activate the remote logging, Hive log and game log are collected for the period of time you set on Hive Console. Hive log is based on the settings on SDK, and game log is flexible for game developers to set the value.
  • Targeting
    Remote logging targets only the users whose device has an ID (DID) through Hive SDK initialization once at least. This function, however, is unavailable to some games if crashes or errors occur before initializing SDK.

  • How remote logging works

  • Sample code
    Insert the following code at every part where game requires to collect logs.

    Unity®

    API Reference: Logger .log

    C++

    API Reference: Logger:: log

    Kotlin
    Java

    API Reference: Logger. INSTANCE.i

    Swift

    API Reference: LogInterface.log

    Objective-C

    API Reference: Objective-C

 

Remote Configuration

Hive enables games to manage game server URL that mapped 1-to-1 with each version of the app. Remote configuration is given in the form of a string by calling getMetaData() API of Configuration class. The following is an example code that calls the remote configuration.

Unity®

API Reference: Configuration.getMetaData

C++

API Reference: Configuration:: getMetaData

Kotlin

API Reference: Configuration.getMetaData

Java

API Reference: Configuration.INSTANCE .getMetaData

Swift

API Reference: ConfigurationInterface.getMetaData

Objective-C

API Reference: HIVEConfiguration getMegaData