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.

How Hive SDK Initialization works

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
  • Get grant access permission for app from users by OS type.
    • Expose if Android 6.0 and later on Android-base devices.
    • Expose in Korean if country IP is Korea on iOS-base devices.
  • From Hive SDK v4.12.1, you can select to unveil or veil the permission notice popup by calling Configuration.setHivePermissionViewOn() method or by editing hive_config.xml file. This feature shorts the step from game start to access to game lobby, and default setting is true. If you select false, make sure to inform the access permission notice to app in market description.
    • How to set on hive_config.xml file
    • How to set on API
      Unity®

      C++

      Android

      iOS

  • Expose the update and notice popups set for the relevant game.
  • Check the user IP and expose Terms of Service by country.
  • Hive Initialization Diagram

Hive SDK Initialization

To initialize Hive Client, implement initialize() method of Auth class. The result of calling the method is delivered through AuthInitResult class. Following table describes the field of AuthInitResult class.

Field Name Description Example
isAuthorized Whether account login is available or not true
loginType Available login type on Hive LoginType.GUEST
did Unique device identifier issued by Hive authentication server to verify Hive login 123456
isPGSLogin Whether Google Play Games is available to sign in (Android only) true
playerName Profile name on Google Play Games (Android only) “i’m pgs user”
playerId User account of Google Play Games (Android only)

Followings are sample codes to initialize Hive Client.

Unity®

API Reference: hive.Auth.initialize

C++

API Reference: Auth::initialize

Android

API Reference: com.hive.Auth.initialize

iOS

API Reference: HIVEAuth::initialize:

 

Hive for New Corporate

From Hive SDK v4.11.4, any game company can use Hive platform. Hive had serviced GAMEVIL and Copm2uS only. However, the global game platform, Hive is now available to new corporates.

Available Resources

When a new corporate publishes a game with Hive platform, following resources are available to modify.

  • With Unity engine
    1. Build your project on the engine, and then create an asset catalog (.xcassets) on your Xcode project.

    2. Save your company logo in the asset catalog, and attach the logo on Terms of Service or Permission notice popup.

    3. Make sure to comply with the following rules to set the name and size of your company’s logo file.

    • File name: auth_logo

    • File size: 270*18


    • File name: auth_copyright

    • File size: 270*11

    • Font color: #9DA3A0

     

Customizing Access Permission Screen to App

Screen design

Hive SDK provides automatic display of permission notice when implementing setup() method in the AuthV4 class or initialize() method in the Auth class. If you’d like to customize notice popup rather than using the default version, however, read the following guide to design game-friendly UI.

Default permission notice popup by Hive SDK
Custom permission notice popup
How to use

Localized resource file required to notify permission is available if you use getPermissionVeiwData() method in the Configuration class prior to implementing initialization function such as setup() method in the AuthV4 class or initialize() method in the Auth class. This API reads Permissions.zip resource file, suitable for the target language, and composes PermissionVeiwData as string type.

Make sure to add the Permissions.zip file to Xcode project before implementing this API on iOS. On Android, it is optional to add the resource file. If you want to edit texts in the resource file, add the Permissions.zip file to your project as mentioned for iOS. If not added, permission notice data is composed of default resources included in Hive SDK. This feature is available with Hive SDK v4.12.1 and later. If your SDK is earlier than v4.12.1, click here to read details to use this feature with requestPermissionViewData() method.

Refer to the following sample codes how to implement getPermissionViewData()method.

Unity®

C++

Android

iOS

Designing permission notice UI with PermissionViewData
  • Composing UI with data
    If you request getPermissionViewData() method, you can obtain PermissionViewData which is composed of data that forms permission notice UI. In PermissionViewData, PermissionViewUnitData explains each permission as a list format.

    • PermissionViewData
      Data name Data type Meaning Exposure to UI
      contents String It explains authority notice popup. Display on UI. O
      permissions Linear list or array
      (depending on language)
      It is linear list or array contained the description and name of each permission. In case new permissions may be added according to OS update or legal policy, design the flexible list, for example, the UI counting data can include various types of values. For more details about data, refer to the following PermissionViewUnitData. Some part of them, O
      commons Linear list or array
      (depending on language)
      It is linear list or array contained the description and name of common item. Make sure to include at least one permission notice to use commons data. For more details about data, refer to the following PermissionViewUnitData. O
    • PermissionViewUnitData
      Data name Data type Meaning
      title String Permission name to expose to UI.
      contents String Permission details to expose to UI. It explains how to use the permission.
      nativePermissionName String Permission name used by each OS.
      permissionCategory enum Permission types not exposed to UI. It describes the permission in use and the function which permission uses. You can use this data by displaying some contents you want on permission UI. To check the permission list, refer to the source code.
  • UI sample
    Following is a sample UI which is composed by calling getPermissionViewData(). See the sample image and design suitable UI for your game.
  • Managing authority notice
    getPermissionViewData() method in the Configuration class is newly provided to have the customizing permission notice popup your own way. It only processes a function to compose permission notice data. It means that you can specify how to implement the process. For example, you can determine whether to expose the popup the first time only or at every update.

    Hive sets to display the popup the first time. If you comply with the Hive policy, make sure to code the following yellow parts with the new API. To check the function of country verification by IP, refer to the server API.

    • Diagram of composing permission notice data

Texts

Depending on the access level, required/optional access permision is displayed. Add and inform the access permission which game requires.

iOS

According to Act on Promotion of Information and Communication Network Utilization and information Protection, permission should be exposed prior to request, and the case of iOS displays the permission popup only to users in Korea. By following the iOS policy, which demands to request permissions at the time of use, three permissions, CAMERA, PHOTO and PUSH are default permissions to notify. CAMERA and PHOTO display permission request popup at the time of use, and PUSH requests at the time of initializing SDK. Even if user denies the permissions, the three optional permissions do not bother the game play.

  1. In your built-Xcode project, uncompress the Permissions.zip file and drag and drop to the subdirectory of the project to organize the resources. In Project > info > Localizations, 15 languages are available, and when you select Permission.strings file, checkmarks are needed for completion as you see in the following inspector video clip. After this, you can customize as you want.

  2. Add the title and explanation of the necessary permission in the available lists of Permission.strings. If you add fifteen language resouces in your Xcode project and prompt to change the Korean resource, for example, Hive SDK v4.12.1 changes the texts in permission notice popup only when you add or edit the texts or title in Permission.strings (Korean).

  3. After successful addition, the permission in detail is displayed when user executes the app for the first time.
Android

By following the Android policy, PHONE is a default permission of Hive SDK permission notice and the access permission notice to OS on devices with Android 6.0 (API Level 23) and later version. PHONE, a default permission to notify, requests to identify device ID at the time of item rewards from game events. Even if user denies the permission, the optional permission does not bother the game play.

If you want to use Android resources, uncompress the Permissions.zip file and copy and paste in ../res folder to customize as you want.

Due to specific featrue of Unity, it conflicts with permission notice resource that Hive SDK contains. Therefore, make sure to add the version at the end of folder name, copy and paste the folder to use permission notice resouces for customization in advance. Refer to the following .gif files for using the resources.

  • Android

  • Cocos2d-x