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.
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.
API Reference: Unity®
1 2 3 4 5 |
using hive; String hiveCertKey = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJIaXZlIiwiaWF0IjoxNjAzNzc4OTU2LCJqdGkiOiIxODczMTExMzIwIn0.OxWo4R6UdI0BLP1ckt8RlMFrPAb5H7TNedmLFV1Cawc"; Configuration.setHiveCertificationKey(hiveCertKey); |
API Reference: C++
1 2 3 4 5 6 7 |
#include <HIVE_SDK_Plugin/HIVE_CPP.h> using namespace std; using namespace hive; string hiveCertKey = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJIaXZlIiwiaWF0IjoxNjAzNzc4OTU2LCJqdGkiOiIxODczMTExMzIwIn0.OxWo4R6UdI0BLP1ckt8RlMFrPAb5H7TNedmLFV1Cawc"; Configuration::setHiveCertificationKey(hiveCertKey); |
API Reference: Kotlin
1 2 3 4 5 |
import com.hive.Configuration val hiveCertKey = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJIaXZlIiwiaWF0IjoxNjAzNzc4OTU2LCJqdGkiOiIxODczMTExMzIwIn0.OxWo4R6UdI0BLP1ckt8RlMFrPAb5H7TNedmLFV1Cawc" Configuration.hiveCertificationKey = hiveCertKey |
API Reference: Java
1 2 3 4 5 |
import com.hive.Configuration; String hiveCertKey = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJIaXZlIiwiaWF0IjoxNjAzNzc4OTU2LCJqdGkiOiIxODczMTExMzIwIn0.OxWo4R6UdI0BLP1ckt8RlMFrPAb5H7TNedmLFV1Cawc"; Configuration.INSTANCE.setHiveCertificationKey(hiveCertkey); |
API Reference: Swift
1 2 3 4 5 |
import HIVEService let hiveCertKey = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJIaXZlIiwiaWF0IjoxNjAzNzc4OTU2LCJqdGkiOiIxODczMTExMzIwIn0.OxWo4R6UdI0BLP1ckt8RlMFrPAb5H7TNedmLFV1Cawc" ConfigurationInterface.setHiveCertificationKey(hiveCertKey) |
API Reference: Objective-C
1 2 3 4 5 |
#import <HIVEService/HIVEService-Swift.h> NSString *hiveCertKey = @"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJIaXZlIiwiaWF0IjoxNjAzNzc4OTU2LCJqdGkiOiIxODczMTExMzIwIn0.OxWo4R6UdI0BLP1ckt8RlMFrPAb5H7TNedmLFV1Cawc"; [HIVEConfiguration setHiveCertificationKey: hiveCertKey]; |
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.
API Reference: hive.AuthV4.setup
1 2 3 4 5 6 7 8 9 10 11 |
// Request Hive SDK Initialization AuthV4.setup ((ResultAPI result, Boolean isAutoSignIn, String did, List providerTypeList) => { if (result.isSuccess()) { // the initialization is successfully done. Handle login based on whether the auto-login is enabled or not. } else if (result.needExit()) { // TODO: Implement the termination of the app // Example) Application.Quit(); } else { // initialization failed } }); |
API Reference: AuthV4::setup
1 2 3 4 5 6 7 8 9 10 11 12 13 |
// Request Hive SDK Initialization AuthV4::setup([=](ResultAPI const & result, bool isAutoSignIn, std::string did, std::vector<ProviderType> const & providerTypeList) { if (result.isSuccess()) { // the initialization is successfully done. Handle login based on whether the auto-login is enabled or not. } else if (result.needExit()) { // TODO: Implement the termination of the app // Users of the Cocos2d-x engine // ex) exit(0); // Unreal engine users // Example) UKismetSystemLibrary::QuitGame(GetWorld(), nullptr, EQuitPreference::Quit, false); } else { // initialization failed } }); |
API Reference: com.hive.AuthV4.setup
1 2 3 4 5 6 7 8 9 |
// Request Hive SDK Initialization AuthV4.setup(object: AuthV4.AuthV4SetupListener{ override fun onAuthV4Setup(result: ResultAPI, isAutoSignIn: Boolean, did: String?, providerTypeList: ArrayList<AuthV4.ProviderType>?) { if (result.isSuccess) { // the initialization is successfully done. Handle login based on whether the auto-login is enabled or not. } else if (result.needExit()) { // TODO: Implement the termination of the app // ex) exitProcess(0) } else { // initialization failed } } }) |
API Reference: com.hive.AuthV4.setup
1 2 3 4 5 6 7 8 9 10 11 12 |
// Request Hive SDK Initialization AuthV4.setup(new AuthV4.AuthV4SetupListener() { @Override public void onAuthV4Setup(ResultAPI result, boolean isAutoSignIn, String did, ArrayList<AuthV4.ProviderType> providerTypeList) { if (result.isSuccess()) { // the initialization is successfully done. Handle login based on whether the auto-login is enabled or not. } else if (result.needExit()) { // TODO: Implement the termination of the app // ex) System.exit(0); } else { // initialization failed } } }); |
API Reference: HIVEAuthV4:setup
1 2 3 4 5 6 7 8 9 10 |
AuthV4Interface.setup { (result, isAutoSignIn, did, providerTypeList) in if result.isSuccess() { // the initialization is successfully done. Handle login based on whether the auto-login is enabled or not. } else if result.needExit() { // TODO: Implement the termination of the app // Example) exit(0) } else { // initialization failed } } |
API Reference: HIVEAuthV4:setup
1 2 3 4 5 6 7 8 9 |
// Request Hive SDK Initialization [HIVEAuthV4 setup:^(HIVEResultAPI *result, BOOL isAutoSignIn, NSString *did, NSArray<NSNumber *> *providerTypeList) { if (result.isSuccess) { // the initialization is successfully done. Handle login based on whether the auto-login is enabled or not. } else if (result.needExit) { // TODO: Implement the termination of the app // ex) exit(0); } else { // Initialization failed } }]; |
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 astrue
. - A request for popup data to customize popups: Set
isShow
parameter asfalse
. For more information about popup data, see Popup Data Returned by Hive below.
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
.
API Reference: Unity®
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
using hive; // Whether to use Hive SDK UI Boolean isShow = true; AuthV4.checkMaintenance(isShow, (ResultAPI result, List maintenanceInfoList) => { if (result.isSuccess()) { // If there is no inspection data // If isShow is false } else if (result.needExit()) { // TODO: Implement app termination functionality // Example) Application.Quit(); } }); |
API Reference: C++
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
#include <HIVE_SDK_Plugin/HIVE_CPP.h> using namespace std; using namespace hive; // Whether to use Hive SDK UI bool isShow = true; AuthV4::checkMaintenance(isShow, [=](ResultAPI const & result, vector const & maintenanceInfolist){ if (result.isSuccess()) { // If there is no registered inspection data // If isShow is false } else if (reuslt.needExit()) { // TODO: Implement app termination functionality // Cocos2d-x engine user // Example) exit(0); // Unreal Engine User // Example) UKismetSystemLibrary::QuitGame(GetWorld(), nullptr, EQuitPreference::Quit, false); } }); |
API Reference: Kotlin
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
import com.hive.AuthV4 import com.hive.ResultAPI // Whether to use Hive SDK UI val isShow = true AuthV4.checkMaintenance(isShow, object : AuthV4.AuthV4MaintenanceListener { override fun onAuthV4Maintenance(result: ResultAPI, maintenanceInfo: ArrayList<AuthV4.AuthV4MaintenanceInfo>?) { if (result.isSuccess) { // If there is no registered inspection data // If isShow is false } else if (result.needExit()) { // TODO: Implement app termination functionality // Example) exitProcess(0) } } }) |
API Reference: Java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
import com.hive.AuthV4; import com.hive.ResultAPI; // Whether to use Hive SDK UI boolean isShow = true; AuthV4.INSTANCE.checkMaintenance(isShow, (result, maintenanceInfo) -> { if (result.isSuccess()) { // If there is no registered inspection data // If isShow is false } else if (result.needExit()) { // TODO: Implement app termination functionality // Example) System.exit(0); } }); |
API Reference: Swift
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
import HIVEService // Whether to use Hive SDK UI let isShow = true AuthV4Interface.checkMaintenance(isShow) { result, maintenances in if result.isSuccess() { // If there is no actual inspection data // If isShow is false } else if result.needExit() { // TODO: Implement app termination functionality // Example) exit(0) } } |
API Reference: Objective-C
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
#import <HIVEService/HIVEService-Swift.h> // Whether to use Hive SDK UI BOOL isShow = YES; [HIVEAuthV4 checkMaintenance:isShow handler: ^(HIVEResultAPI *result, NSArray<HIVEAuthV4MaintenanceInfo *> *maintenanceInfolist) { if (result.isSuccess) { // If there is no registered inspection data // If isShow is false } else if (result.needExit) { // TODO: Implement app termination functionality // Example) exit(0); } }]; |
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_URLString 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_URLString
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.
To display Terms of Service when click the button or link, call showTerms()
method of AuthV4 class. Followings are sample codes.
API Reference: Unity®
1 2 3 4 5 6 7 |
using hive; AuthV4.showTerms((ResultAPI result) => { if (result.isSuccess()) { // API call success } }); |
API Reference: C++
1 2 3 4 5 6 7 8 9 |
#include <HIVE_SDK_Plugin/HIVE_CPP.h> using namespace std; using namespace hive; AuthV4::showTerms([=](ResultAPI const & result) { if (result.isSuccess()) { // API call success } }); |
API Reference: Kotlin
1 2 3 4 5 6 7 8 9 10 |
import com.hive.AuthV4 import com.hive.ResultAPI AuthV4.showTerms(object : AuthV4.AuthV4ShowTermsListener { override fun onAuthV4ShowTerms(result: ResultAPI) { if (result.isSuccess) { // API call success } } }) |
API Reference: Java
1 2 3 4 5 6 7 8 |
import com.hive.AuthV4; import com.hive.ResultAPI; AuthV4.INSTANCE.showTerms(result -> { if (result.isSuccess()) { // API call success } }); |
API Reference: Swift
1 2 3 4 5 6 7 |
import HIVEService AuthV4Interface.showTerms() { result in if result.isSuccess() { // API call success } } |
API Reference: Objective-C
1 2 3 4 5 6 7 |
#import <HIVEService/HIVEService-Swift.h> [HIVEAuthV4 showTerms:^(HIVEResultAPI *result) { if ([result isSuccess]) { // API call success } }]; |
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.
1 2 3 |
using hive; AuthV4.resetAgreement(); |
1 2 3 4 |
#include <HIVE_SDK_Plugin/HIVE_CPP.h> using namespace hive; AuthV4::resetAgreement(); |
1 2 3 |
import com.hive.AuthV4 AuthV4.resetAgreement() |
1 2 3 |
import com.hive.AuthV4; AuthV4.INSTANCE.resetAgreement(); |
1 2 3 |
import HIVEService AuthV4Interface.resetAgreement() |
1 2 3 |
#import <HIVEService/HIVEService-Swift.h> [AuthV4Interface resetAgreement]; |
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.
API Reference: AuthV4.showProfile
1 2 3 4 5 6 7 8 9 10 |
using hive; // playerId of the logged-in user Int64 playerId = 12345; AuthV4.showProfile(playerId, (ResultAPI result) => { if (result.isSuccess()) { // Call successful } }); |
API Reference: AuthV4::showProfile
1 2 3 4 5 6 7 8 9 10 11 12 |
#include <HIVE_SDK_Plugin/HIVE_CPP.h> using namespace std; using namespace hive; // playerId of the logged-in user long long playerId = 12345; AuthV4::showProfile(playerId, [=](ResultAPI const & result){ if (result.isSuccess()) { // Call successful } }); |
API Reference: AuthV4.showProfile
1 2 3 4 5 6 7 8 9 10 11 12 13 |
import com.hive.AuthV4 import com.hive.ResultAPI // playerId of the logged-in user val playerId = 12345L AuthV4.showProfile(playerId, object : AuthV4.AuthV4ShowProfileListener{ override fun onAuthV4ShowProfile(result: ResultAPI) { if (result.isSuccess) { // Call successful } } }) |
API Reference: AuthV4.INSTANCE.showProfile
1 2 3 4 5 6 7 8 9 10 11 |
import com.hive.AuthV4; import com.hive.ResultAPI; // playerId of the logged-in user long playerId = 12345; AuthV4.INSTANCE.showProfile(playerId, result -> { if (result.isSuccess()) { // Call successful } }); |
API Reference: AuthV4Interface.showProfile
1 2 3 4 5 6 7 8 9 10 |
import HIVEService // playerId of the logged-in user let playerId: Int64 = 12345 AuthV4Interface.showProfile(playerId) { result in if result.isSuccess() { // Call successful } } |
API Reference: [HIVEAuthV4 showProfile]
1 2 3 4 5 6 7 8 9 10 |
#import <HIVEService/HIVEService-Swift.h> // playerId of the logged-in user long long playerId = 12345; [HIVEAuthV4 showProfile: playerId handler: ^(HIVEResultAPI *result) { if ([result isSuccess]) { // Call successful } }]; |
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()
.
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.
To expose the inquiry page, call showInquiry()
method in the AuthV4 class.
Followings are sample codes to display the inquiry page.
API Reference: AuthV4 .showInquiry
1 2 3 4 5 6 7 |
using hive; AuthV4.showInquiry((ResultAPI result) => { if (result.isSuccess()) { // call successful } }); |
API Reference: AuthV4 ::showInquiry
1 2 3 4 5 6 7 8 9 |
#include <HIVE_SDK_Plugin/HIVE_CPP.h> using namespace std; using namespace hive; AuthV4::showInquiry([=](ResultAPI const & result) { if (result.isSuccess()) { // call successful } }); |
API Reference: AuthV4.showInquiry
1 2 3 4 5 6 7 8 9 10 |
import com.hive.AuthV4 import com.hive.ResultAPI AuthV4.showInquiry(object : AuthV4.AuthV4ShowInquiryListener { override fun onAuthV4ShowInquiry(result: ResultAPI) { if (result.isSuccess) { // call successful } } }) |
API Reference: AuthV4 .INSTANCE.showInquiry
1 2 3 4 5 6 7 8 |
import com.hive.AuthV4; import com.hive.ResultAPI; AuthV4.INSTANCE.showInquiry(result -> { if (result.isSuccess()) { // call successful } }); |
API Reference: AuthV4Interface .showInquiry
1 2 3 4 5 6 7 |
import HIVEService AuthV4Interface.showInquiry() { result in if result.isSuccess() { // call successful } } |
API Reference: [ HIVEAuthV4 showInquiry]
1 2 3 4 5 6 7 |
#import <HIVEService/HIVEService-Swift.h> [HIVEAuthV4 showInquiry: ^(HIVEResultAPI *result) { if ([result isSuccess]) { // call successful } }]; |
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.
API Reference: hive.AuthV4 .showMyInquiry
1 2 3 4 5 6 7 |
using hive; AuthV4.showMyInquiry((ResultAPI result) => { if (result.isSuccess()) { // call successful } }); |
API Reference: AuthV4:: showMyInquiry
1 2 3 4 5 6 7 8 9 |
#include <HIVE_SDK_Plugin/HIVE_CPP.h> using namespace std; using namespace hive; AuthV4::showMyInquiry([=](ResultAPI const & result) { if (result.isSuccess()) { // call successful } }); |
API Reference: AuthV4.showMyInquiry
1 2 3 4 5 6 7 8 9 10 |
import com.hive.AuthV4 import com.hive.ResultAPI AuthV4.showMyInquiry(object : AuthV4.AuthV4ShowMyInquiryListener { override fun onAuthV4ShowMyInquiry(result: ResultAPI) { if (result.isSuccess) { // call successful } } }) |
API Reference: com.hive .AuthV4.showMyInquiry
1 2 3 4 5 6 7 8 |
import com.hive.AuthV4; import com.hive.ResultAPI; AuthV4.INSTANCE.showMyInquiry(result -> { if (result.isSuccess()) { // call successful } }); |
API Reference: AuthV4Interface .showMyInquiry
1 2 3 4 5 6 7 |
import HIVEService AuthV4Interface.showMyInquiry() { result in if result.isSuccess() { // call successful } } |
API Reference: HIVEAuthV4:: showMyInquiry
1 2 3 4 5 6 7 |
#import <HIVEService/HIVEService-Swift.h> [HIVEAuthV4 showMyInquiry: ^(HIVEResultAPI *result) { if ([result isSuccess]) { // call successful } }]; |
Hive Chatbot CS
Inquiry via 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.
API Reference: hive .AuthV4.showChatbotInquiry
1 2 3 4 5 6 7 8 9 10 |
using hive; // String data in JSON format promised to be delivered when calling the chatbot page shortcut API String additionalInfo = "{ \"init_path\":\"hive_sdk_api\" }"; AuthV4.showChatbotInquiry(additionalInfo, (ResultAPI result) => { if (result.isSuccess()) { // call successful } }); |
API Reference: AuthV4 ::showChatbotInquiry
1 2 3 4 5 6 7 8 9 10 11 12 |
#include <HIVE_SDK_Plugin/HIVE_CPP.h> using namespace std; using namespace hive; // String data in JSON format promised to be delivered when calling the chatbot page shortcut API string additionalInfo = "{ \"init_path\":\"hive_sdk_api\" }"; AuthV4::showChatbotInquiry(additionalInfo, [=](ResultAPI const &result) { if (result.isSuccess()) { // call successful } }); |
API Reference: AuthV4.showChatbotInquiry
1 2 3 4 5 6 7 8 9 10 11 12 13 |
import com.hive.AuthV4 import com.hive.ResultAPI // String data in JSON format promised to be delivered when calling the chatbot page shortcut API val additionalInfo = "{ \"init_path\":\"hive_sdk_api\" }" AuthV4.showChatbotInquiry(additionalInfo, object : AuthV4.AuthV4ShowChatbotInquiryListener { override fun onAuthV4ShowChatbotInquiry(result: ResultAPI) { if (result.isSuccess) { // call successful } } }) |
API Reference: com.hive .AuthV4.showChatbotInquiry
1 2 3 4 5 6 7 8 9 10 11 |
import com.hive.AuthV4; import com.hive.ResultAPI; // String data in JSON format promised to be delivered when calling the chatbot page shortcut API String additionalInfo = "{ \"init_path\":\"hive_sdk_api\" }"; AuthV4.INSTANCE.showChatbotInquiry(additionalInfo, result -> { if (result.isSuccess()) { // call successful } }); |
API Reference: AuthV4Interface.showChatbotInquiry
1 2 3 4 5 6 7 8 9 10 |
import HIVEService // String data in JSON format promised to be delivered when calling the chatbot page shortcut API let additionalInfo = "{ \"init_path\":\"hive_sdk_api\" }" AuthV4Interface.showChatbotInquiry(additionalInfo) { result in if result.isSuccess() { // call successful } } |
API Reference: HIVEAuthV4:: showChatbotInquiry
1 2 3 4 5 6 7 8 9 10 |
#import <HIVEService/HIVEService-Swift.h> // String data in JSON format promised to be delivered when calling the chatbot page shortcut API NSString *additionalInfo = @"{ \"init_path\":\"hive_sdk_api\" }"; [HIVEAuthV4 showChatbotInquiry:additionalInfo handler:^(HIVEResultAPI *result) { if ([result isSuccess]) { // call successful } }]; |
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.
1 2 3 4 5 6 7 8 9 10 |
// Implement the following AppDelegate function if your game engine is in Objective-c. - (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window { // TODO: For landscape only return UIInterfaceOrientationMaskLandscape; // TODO: For portrait only return UIInterfaceOrientationMaskPortrait; // TODO: For both landscape and portrait return UIInterfaceOrientationMaskAll; } |
1 2 3 4 5 6 7 8 9 10 |
// Implement the following AppDelegate function if your game engine is in Swift. func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask { // TODO: For landscape only return [.landscape] // TODO: For portrait only return [.portrait] // TODO: For both landscape and portrait return .all } |
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.
API Reference: SocialV4 .showCommunity
1 2 3 4 5 6 7 8 9 10 |
using hive; // Set view type (FullScreen: full screen, Frame: frame screen) SocialV4.ViewType viewType = SocialV4.ViewType.Frame; SocialV4.showCommunity(SocialV4.ProviderType.HIVE, viewType, (ResultAPI result) => { if (result.isSuccess()) { // call successful } }); |
API Reference: SocialV4 .showCommunity
1 2 3 4 5 6 7 8 9 10 11 12 |
#include <HIVE_SDK_Plugin/HIVE_CPP.h> using namespace std; using namespace hive; // Set view type (FullScreen: full screen, Frame: frame screen) SocialV4::ViewType viewType = SocialV4::ViewType::Frame; SocialV4.showCommunity(SocialV4::ProviderType::HIVE, viewType, (ResultAPI const & result) { if (result.isSuccess()) { // call successful } }); |
API Reference: SocialV4.showCommunity
1 2 3 4 5 6 7 8 9 10 11 12 13 |
import com.hive.SocialV4 import com.hive.ResultAPI // Set view type (FullScreen: full screen, Frame: frame screen) val viewType = SocialV4.ViewType.Frame SocialV4.showCommunity(SocialV4.ProviderType.HIVE, viewType, object : SocialV4.SocialV4ShowCommunityListener{ override fun onShowCommunity(result: ResultAPI) { if (result.isSuccess) { // call successful } } }) |
API Reference: SocialV4.INSTANCE .showCommunity
1 2 3 4 5 6 7 8 9 10 11 |
import com.hive.SocialV4; import com.hive.ResultAPI; // Set view type (FullScreen: full screen, Frame: frame screen) SocialV4.ViewType viewType = SocialV4.ViewType.Frame; SocialV4.INSTANCE.showCommunity(SocialV4.ProviderType.HIVE, viewType, result -> { if (result.isSuccess()) { // call successful } }); |
API Reference: SocialV4Interface.showCommunity
1 2 3 4 5 6 7 8 9 10 |
import HIVEService // Set view type (FullScreen: full screen, Frame: frame screen) let viewType = SocialViewType.Frame SocialV4Interface.showCommunity(.HIVE, viewType) { result in if result.isSuccess() { // call successful } } |
API Reference: HIVESocialV4 showCommunity
1 2 3 4 5 6 7 8 9 10 |
#import <HIVEService/HIVEService-Swift.h> // Set view type (FullScreen: full screen, Frame: frame screen) HIVESocialViewType viewType = HIVESocialViewTypeFrame; [HIVESocialV4 showCommunity: HVIESocialProviderTypeHIVE viewType: viewType handler: ^(HIVEResultAPI *result) { if ([result isSuccess]) { // call successful } }]; |
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. -
Sample code
Insert the following code at every part where game requires to collect logs.Unity®API Reference: Logger .log
123using hive;Logger.log("Enter logging contents");C++API Reference: Logger:: log
12345#include <HIVE_SDK_Plugin/HIVE_CPP.h>using namespace std;using namespace hive;Logger::log("Enter logging contents");KotlinAPI Reference: Logger.i a>
123import com.hive.LoggerLogger.i("Enter logging contents")JavaAPI Reference: Logger. INSTANCE.i
123import com.hive.Logger;Logger.INSTANCE.i("Enter logging contents");SwiftAPI Reference: LogInterface.log
123import HIVEBaseLogInterface.log(sourceInfo: "Log source information (class, method name)", type: .Info, tag: "Log tag", msg: "Log message")Objective-CAPI Reference: Objective-C
123#import <HIVEBase/HIVEBase-Swift.h>[HIVELogger logWithSourceInfo:@"Log source information (class, method name)" type: LogTypeInfo tag: @"Log tag" msg: @"Log message"];
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.
API Reference: Configuration.getMetaData
1 2 3 4 5 6 7 8 9 10 11 12 13 |
using hive; // data key String key = "game_server_url"; // Whether data is updated Boolean forceReload = false; // metadata call Configuration.getMetaData(key, forceReload, (ResultAPI result, String value) => { if (result.isSuccess()) { // call successful } }); |
API Reference: Configuration:: getMetaData
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
#include <HIVE_SDK_Plugin/HIVE_CPP.h> using namespace std; using namespace hive; // data key string key = "game_server_url"; // Whether data is updated bool forceReload = false; // metadata call Configuration::getMetaData(key, forceReload, [=](ResultAPI const & result, string value) { if (result.isSuccess()) { // call successful } }); |
API Reference: Configuration.getMetaData
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
import com.hive.Configuration import com.hive.ResultAPI // data key val key = "game_server_url" // Whether data is updated val forceReload = false // metadata call Configuration.getMetaData(key, forceReload, object : Configuration.GetMetaDataListener { override fun onGetMetaData(result: ResultAPI, data: String) { if (result.isSuccess) { // call successful } } }) |
API Reference: Configuration.INSTANCE .getMetaData
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
import com.hive.Configuration; import com.hive.ResultAPI; // data key String key = "game_server_url"; // Whether data is updated boolean forceReload = false; // metadata call Configuration.INSTANCE.getMetaData(key, forceReload, (result, data) -> { if (result.isSuccess()) { // call successful } }); |
API Reference: ConfigurationInterface.getMetaData
1 2 3 4 5 6 7 8 9 10 11 12 13 |
import HIVEService // data key let key = "game_server_url" // Whether data is updated let forceReload = false; // metadata call ConfigurationInterface.getMetaData(key, forceReload: forceReload) { result, value in if result.isSuccess() { // call successful } } |
API Reference: HIVEConfiguration getMegaData
1 2 3 4 5 6 7 8 9 10 11 12 13 |
#import <HIVEService/HIVEService-Swift.h> // data key NSString *key = @"game_server_url"; // Whether data is updated BOOL forceload = NO; // metadata call [HIVEConfiguration getMegaData: key forceReload: forceReload handler: ^(HIVEResultAPI *result, NSString *value) { if ([result isSuccess]) { // call successful } }]; |