Advanced function provides custom section; Custom View that allows you to display HTML page you want, Custom Board that can display customized bulletin board, Spot Banner and Direct View that can display specific banner registered on Hive console at desired point.

Custom View

Custom View is a function that exposes an external URL or input content to a web view with a separate button in the game. One and more custom views are available in a game so it can be used in various ways under diverse situations.

Registration

Hive Console provides an editor to create and compose custom view. You can register external links through Hive Console as the same way of setting the general custom view.
For more information to create and register custom view, see Hive Console Promotion.

Creation

To display Custom View registered on Hive Console or for external page, call showCustomContents() method of Promotion class as following explanation.

  • Set customType as PromotionCustomType.VIEW parameter.
  • Set contentsKey parameter as the Custom View ID in Hive Console > Promotion > Campaign Settings > Custom View Tab > Management Name.
Unity®

API Reference: hive.Promotion.showCustomContents

C++

API Reference: Promotion::showCustomContents

Kotlin

API Reference: Promotion.showCustomContents

Java

API Reference: Promotion.INSTANCE.showCustomContents

Swift

API Reference: PromotionInterface.showCustomContents

Objective-C

API Reference: HivePromotion:showCustomContents

Custom Board

Unlike general promotion notice, Custom Board is available to display a list of bulletin boards for various purposes within the game.

  • An example of Custom Board

Registration

For more information to create and register the Custom Board, see Hive Console Promotion Guide.

Creation

To display a Custom Board, set the parameter as following explanation and then call showCustomContents() method of Promotion class.

  • Set customType as PromotionCustomType.BOARD parameter.
  • Set contentsKey parameter as Board Key in Hive Console > Promotion > Custom Board.

Followings are sample codes to display Custom Board.

Unity®

API Reference: hive.Promotion.showCustomContents

C++

API Reference: Promotion::showCustomContents

Kotlin

API Reference: Promotion.showCustomContents

Java

API Reference: com.hive.Promotion.showCustomContents

Swift

API Reference: PromotionInterface.showCustomContents

Objective-C

API Reference: HivePromotion:showCustomContents

Spot Banner

Spot Banner allows you to expose full banners at a desired location or timing in the game. You can register the spot banners on Hive Console > Promotion > Campaign Settings > Spot Banner.

To display Spot Banner, set the parameter as following explanation and then call showCustomContents() method of Promotion class.

  • Set customType as PromotionCustomType.SPOT parameter.
  • Set contentsKey parameter as the Spot Banner ID in Hive Console > Promotion > Campaign Settings > Spot Banner Tab > Management Name. This feature is available on the games with SDK v4.

Followings are sample codes to create Spot Banner.

Unity®

API Reference: hive.Promotion.showCustomContents

C++

API Reference: Promotion::showCustomContents

Kotlin

API Reference: Promotion.showCustomContents

Java

API Reference: com.hive.Promotion.showCustomContents

Swift

API Reference: PromotionInterface.showCustomContents

Objective-C

API Reference: HivePromotion:showCustomContents

Direct View

Direct View is a function that invokes the campaign number registered on the Hive console from the game and exposes directly. When you call the campaign ID registered in the Hive console in the game, the corresponding contents is displayed as a frame or the full screen.
From the Hive SDK 4.16.0, you can display in full screen or frame type depending on the exposure type set in Promotion > Campaign Settings in the Hive console.

  • Full Screen Type
  • Frame Type

To display Direct View, set the parameter as following explanation and then call the showCustomContents() method in the Promotion class.

  • Set customType as PromotionCustomType.DIRECT parameter.
  • Set contentsKey parameter as the Campaign number in Hive Console > Promotion > Campaign Settings > Normal Banner Tab.

Followings are sample codes to create Direct View.

Unity®

API Reference: hive.Promotion.showCustomContents

C++

API Reference: Promotion::showCustomContents

Kotlin

API Reference: Promotion.showCustomContents

Java

API Reference: com.hive.Promotion.showCustomContents

Swift

API Reference: PromotionInterface.showCustomContents

Objective-C

API Reference: HivePromotion:showCustomContents

Implement Your Own Banner

The Hive SDK provides exposing the desired campaigns as banners via showPromotion method. However, you may want to expose a banner (rolling banner) that is not provided by the Hive SDK, or you may want to customize and expose a banner provided by the Hive SDK as you wish.
To implement your own banner, you need to follow the steps below.

  • Register the information (the banner image, link, etc.) of the banner to be implemented and exposed in the Hive console.
  • Call Hive SDK‘s getBannerInfo() to get the information needed to implement the banner from the Hive server.
  • Based on the received information, implement the banner and expose it in the game.

Rolling Banner

A rolling banner is a banner whose content is flowing. To expose rolling banners, the game studio must implement and expose them by themselves.

Get Banner Information

getBannerInfo is a function that obtains the information needed to expose the banner in a desired standard when the game studio wants to directly implement the banner. When this API fetches the data for configuring the banner from the Hive server, your game can use this data to display the banner however you want. To call this API, Authentication v1 or Authentication v4 must be initialized. If not initialized, the problems may occur in receiving data.

API Request Example

Unity®

API Reference: hive .Promotion.getBannerInfo

C++

API Reference: Promotion ::getBannerInfo

Kotlin

API Reference: Promotion.getBannerInfo

Java

API Reference: Promotion .INSTANCE.getBannerInfo

Swift

API Reference: PromotionInterface.getBannerInfo

Objective-C

API Reference: HIVEPromotion getBannerInfo

API Response: PromotionBannerInfo

In the API response, the banner information required to implement the banner is in the PromotionBannerInfo object (array). For more details, see the tabl below.

Field Name Type Description
pid Integer Promotion campaign ID
imageUrl String The image URL of campaign banner
linkUrl String The URL opening when user clicks a campaign banner
displayStartDate String The start time of campaign
displayEndDate String The end time of campaign
utcStartDate Integer The start time of campaign (Unix timestamp)
utcEndDate Integer The end time of campaign (Unix timestamp)
typeLink String The type to open pages when user clicks a campaign banner.
Select when registering campaigns.

  • webview: Open an internal link
  • webbrowser: Open an external link
  • market: Open the market (App Store) page
  • notice: Open the Hive notice page
  • text: Open the promotion text notice
  • none: Stay on the page
typeBanner String The type of campaign banner

  • great: Full banner
  • small: Normal banner
  • rolling: Rolling banner
typeCampaign String The campaign type of promotion

  • all: all
  • event: event
  • notice: notice
  • cross: cross full banner
interworkData String

JSON data containing the API and parameters to move a user to a specific location in the game. This data is in String format.

For example, if a user clicks on a customized event rolling banner, you can direct this user to a purchase screen for a specific event item.

Campaign Data Search

Hive provides a function to search campaign data registered on Hive Console. This function is useful when you directly show the contents of registered campaign on Hive Console in the game rather than using Hive Promotion View.
Following campaign type is available for search; Custom View, Custom Board, Spot Banner and Direct View. showCustomContents() method of Promotion class can explain these four types.

Data Form

Hive returns promotion information with PromotionViewInfo object array because spot banner is available to comprise several banners like full banners. Even if custom view, custom board and direct view comprise single form, Hive returns the information of all campaigns with array type.

Following table is a composition of PromotionViewInfo object.

Name Type Description
url String Page URL to be loaded by WebView
postString String POST String required to load WebView

Data Search

To search campaign data registered on Hive Console, set the unique ID of promotion as the first parameter to call getViewInfo() method of Promotion class. Then, return the callback method which receives campaign data.
Followings are sample codes to request a campaign with unique ID, 310000. Samples for Android and iOS contain the codes displaying data from Hive directly on WebView.

Unity®

API Reference: hive.Promotion.getViewInfo

C++

API Reference: Promotion::getViewInfo

Kotlin

API Reference: Promotion.getViewInfo

Java

API Reference: com.hive.Promotion.getViewInfo

Swift

API Reference: PromotionInterface.getViewInfo

Objective-C

API Reference: HIVEPromotion:getViewInfo

Send additional information to promotion server

The additional information here is the custom data defined by your game company. The game companies can forward additional information to the Hive promotion server and use it for various services given the cooperations between a game company and Com2uS Platform. For example, you can define your game’s player character level information in additionalInfo as follows.

 
After sending the above additionalInfo to Hive promotion server using the setAdditionalInfo method, please work with Com2uS Platform about the implementation details. For example, when exposing a specific event page (direct view, custom view, etc.), an event banner bordered in gold color can be displayed for a user with a game character at a level above 50.
You can also use it as a function to add a gift box image to the news banner by entering the campaign number in additionalInfo.

The following is an example code that passes additionalInfo.

Unity®

API Reference: hive.Promotion.setAdditionalInfo

C++

API Reference: Promotion::setAdditionalInfo

Kotlin

API Reference: Promotion.setAdditionalInfo

Java

API Reference: Promotion .INSTANCE.setAdditionalInfo

Swift

API Reference: PromotionInterface .setAdditionalInfo

Objective-C

API Reference: HIVEPromotion::setAdditionalInfo

The additional information can be used for all Hive SDK promotion features. Therefore, before implementing any Hive promotion features, we recommend that you first call setAdditionalInfo after defining the additional information and how it will be utilized.

Event Display without Title Bar

You can delete Hive title bar on event page linked from full banner, Spot Banner, news page, or Direct View. To display event page without Hive title bar, call setAdditionalInfo method of Promotion class before calling showCustomContents() method to set header field as Off. You can remove the Hive title bar from an exposed page by organizing the additionalInfo and sending it to the Hive server, described as below.

Followings are sample codes to release title bar.

Unity®

API Reference: hive.Promotion.setAdditionalInfo

C++

API Reference: Promotion::setAdditionalInfo

Kotlin

API Reference: Promotion.setAdditionalInfo

Java

API Reference: Promotion.INSTANCE.setAdditionalInfo

Swift

API Reference: PromotionInterface .setAdditionalInfo

Objective-C

API Reference: HIVEPromotion setAdditionalInfo

Playing Video Clips on Promotion

Display a video clip on your game promotion with Hive SDK v4.7.0 and later. If user clicks a play link, the full-screen video shows up. To do this, make sure to code the functions which volume down before playing the video, and volume up after playing it.

  • The state before and after displaying video clips are sent to the handler of API which implemented promotion. StartPlayback, FinishPlayback are sent to PromotionViewResultType; and kPromotionStartPlayback, kPromotionFinishPlayback are sent to the part of Result API code.
    • WebKit.framework and libz.tbd are new to the framework added to iOS Xcode.

Following is the sample code to control the game volume to play a video clip on promotion page.

Unity®

API Reference: onPromotionView

C++

API Reference: onPromotionView

Kotlin

API Reference: onPromotionView

Java

API Reference: Promotion .PromotionViewListener

Swift

API Reference: PromotionViewHandler

Objective-C

API Reference: HIVEPromotionViewHandler