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
- Starting from Hive SDK v4.16.2, the SDK does not notify app access rights directly. Check out the FAQ for more details.
- 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 } }]; |
Notify App Access Permission
Screen design
Read this guide carefully if you want to change your pop-up to a game-specific custom pop-up that matches the game UI.
- 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 Premissions.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.
API Reference: Unity®
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
using hive; /* Supported Language List HIVELanguageAR, // Arabic HIVELanguageDE, // German HIVELanguageEN, // English HIVELanguageES, // Spanish HIVELanguageFR, // French HIVELanguageID, // Indonesian HIVELanguageIT, // Italian HIVELanguageJA, // Japanese HIVELanguageKO, // Korean HIVELanguagePT, // Portuguese HIVELanguageRU, // Russian HIVELanguageTH, // Thai HIVELanguageTR, // Turkish HIVELanguageVI, // Vietnamese HIVELanguageZHS, // Simplified Chinese HIVELanguageZHT // Traditional Chinese */ HIVELanguage language = HIVELanguage.HIVELanguageEN; PermissionViewData data = Configuration.getPermissionViewData(language); //language is enum HIVELanguage // Title: data.contents for (int i = 0; i < data.permissions.Count; i++) { /* Permission name: data.permissions[i].nativePermissionName Title: data.permissions[i].title Content: data.permissions[i].contents Category: data.permissions[i].permissionCategory */ } for (int i = 0; i < data.commons.Count; i++) { /* Only exists when there is more than one data.permissions (permission notice content). Permission name: data.commons[i].nativePermissionName Title: data.commons[i].title Contents: data.commons[i].contents Category: data.commons[i].permissionCategory */ } |
API Reference: C++
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
#include <HIVE_SDK_Plugin/HIVE_CPP.h> using namespace std; using namespace hive; /* Supported Language List HIVELanguageAR, // Arabic HIVELanguageDE, // German HIVELanguageEN, // English HIVELanguageES, // Spanish HIVELanguageFR, // French HIVELanguageID, // Indonesian HIVELanguageIT, // Italian HIVELanguageJA, // Japanese HIVELanguageKO, // Korean HIVELanguagePT, // Portuguese HIVELanguageRU, // Russian HIVELanguageTH, // Thai HIVELanguageTR, // Turkish HIVELanguageVI, // Vietnamese HIVELanguageZHS, // Simplified Chinese HIVELanguageZHT // Traditional Chinese */ HIVELanguage language = HIVELanguage.HIVELanguageEN; PermissionViewData data = Configuration::getPermissionViewData(language); //language is enum HIVELanguage // Title: data.contents.c_str() for (auto unit : data.permissions) { /* Permission name: unit.nativePermissionName.c_str() Title: unit.title.c_str() Contents: unit.contents.c_str() Category: unit.permissionCategory */ } for (auto unit : data.commons) { /* Only exists when there is more than one data.permissions (permission notice content). Permission name: unit.nativePermissionName.c_str() Title: unit.title.c_str() Contents: unit.contents.c_str() Category: unit.permissionCategory */ } |
API Reference: Kotlin
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
import com.hive.Configuration /* Supported Language List Configuration.HiveLanguage.LanguageAR // Arabic Configuration.HiveLanguage.LanguageDE // German Configuration.HiveLanguage.LanguageEN // English Configuration.HiveLanguage.LanguageES // Spanish Configuration.HiveLanguage.LanguageFR // French Configuration.HiveLanguage.LanguageIN // Indonesian Configuration.HiveLanguage.LanguageIT // Italian Configuration.HiveLanguage.LanguageJA // Japanese Configuration.HiveLanguage.LanguageKO // Korean Configuration.HiveLanguage.LanguagePT // Portuguese Configuration.HiveLanguage.LanguageRU // Russian Configuration.HiveLanguage.LanguageTH // Thai Configuration.HiveLanguage.LanguageTR // Turkish Configuration.HiveLanguage.LanguageVI // Vietnamese Configuration.HiveLanguage.LanguageZHS // Simplified Chinese Configuration.HiveLanguage.LanguageZHT // Traditional Chinese */ val language = Configuration.HiveLanguage.LanguageEN val data = Configuration.getPermissionViewData(language) for (i in 0 until data.permissions.size) { /* Permission name: data.permissions[i].nativePermissionName Title: data.permissions[i].title Content: data.permissions[i].contents Category: data.permissions[i].permissionCategory */ } for (i in 0 until data.commons.size) { /* Only exists when there is more than one data.permissions (permission notice content). Permission name: data.commons[i].nativePermissionName Title: data.commons[i].title Contents: data.commons[i].contents Category: data.commons[i].permissionCategory */ } |
API Reference: Java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
import com.hive.Configuration; /* Supported Language List Configuration.HiveLanguage.LanguageAR // Arabic Configuration.HiveLanguage.LanguageDE // German Configuration.HiveLanguage.LanguageEN // English Configuration.HiveLanguage.LanguageES // Spanish Configuration.HiveLanguage.LanguageFR // French Configuration.HiveLanguage.LanguageIN // Indonesian Configuration.HiveLanguage.LanguageIT // Italian Configuration.HiveLanguage.LanguageJA // Japanese Configuration.HiveLanguage.LanguageKO // Korean Configuration.HiveLanguage.LanguagePT // Portuguese Configuration.HiveLanguage.LanguageRU // Russian Configuration.HiveLanguage.LanguageTH // Thai Configuration.HiveLanguage.LanguageTR // Turkish Configuration.HiveLanguage.LanguageVI // Vietnamese Configuration.HiveLanguage.LanguageZHS // Simplified Chinese Configuration.HiveLanguage.LanguageZHT // Traditional Chinese */ Configuration.HiveLanguage language = Configuration.HiveLanguage.LanguageEN; Permission.PermissionViewData data = Configuration.INSTANCE.getPermissionViewData(language); for(Permission.PermissionViewUnitData unit : data.getPermissions()) { /* Permission name: unit.getNativePermissionName(); Title: unit.getTitle(); Contents: unit.getContents(); Category: unit.getPermissionCategory(); */ } for(Permission.PermissionViewUnitData unit : data.getCommons()) { /* Only exists when there is more than one data.permissions (permission notice content). Permission name: unit.getNativePermissionName(); Title: unit.getTitle(); Contents: unit.getContents(); Category: unit.getPermissionCategory(); */ } |
API Reference: Swift
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
import HIVEService /* Supported Language List AR, // Arabic DE, // German EN, // English ES, // Spanish FR, // French ID, // Indonesian IT, // Italian JA, // Japanese KO, // Korean PT, // Portuguese RU, // Russian TH, // Thai TR, // Turkish VI, // Vietnamese ZHS, // Simplified Chinese ZHT // Traditional Chinese */ let language: HIVELanguage = .EN let data = ConfigurationInterface.getPermissionViewData(language) // Title: data.contents for permission in data.permissions { /* Permission name: permission.nativePermissionName Title: permission.title Contents: permission.contents Category: permission.permissionCategory */ } for common in data.commons { /* Only exists when there is more than one data.permissions (permission notice content). Permission Name: common.nativePermissionName Title: common.title Contents: common.contents Category: common.permissionCategory */ } |
API Reference: Objective-C
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
#import <HIVEService/HIVEService-Swift.h> /* Supported Language List HIVELanguageAR, // Arabic HIVELanguageDE, // German HIVELanguageEN, // English HIVELanguageES, // Spanish HIVELanguageFR, // French HIVELanguageID, // Indonesian HIVELanguageIT, // Italian HIVELanguageJA, // Japanese HIVELanguageKO, // Korean HIVELanguagePT, // Portuguese HIVELanguageRU, // Russian HIVELanguageTH, // Thai HIVELanguageTR, // Turkish HIVELanguageVI, // Vietnamese HIVELanguageZHS, // Simplified Chinese HIVELanguageZHT, // Traditional Chinese */ HIVELanguage language = HIVELanguageEN; HIVEPermissionViewData *data = [HIVEConfiguration getPermissionViewData:language]; // Title: [data contents]]; for (HIVEPermissionViewUnitData *permission in [data permissions]) { /* Permission name: [permission nativePermissionName] Title: [permission title] Contents: [permission contents] Category: [permission permissionCategory] */ } for (HIVEPermissionViewUnitData *common in [data commons]) { /* [data permissions] (permission notice content) exists only when there is more than one. Permission name: [common nativePermissionName] Title: [common title] Contents: [common contents] Category: [common permissionCategory] */ } |
Designing permission notice UI with PermissionViewData
- Composing UI with data
If you requestgetPermissionViewData()
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.
- PermissionViewData
- UI sample
Following is a sample UI which is composed by callinggetPermissionViewData()
. 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.
Texts
Depending on the access level, required/optional access permision is displayed. Add and inform the access permission which game requires.
iOS
According to the iOS policy to request permission at the time of use, the 4 permissions, CAMERA, PHOTO, PUSH, and IDFA, are set as the default items for the app access permission notice. For the IDFA permission, a permission request pop-up is created when the Hive SDK is initialized. For the CAMERA and PHOTO permission, a permission request pop-up appears when the function is actually used. For the PUSH permission, it is requested when the SDK is initialized. All four items are optional, so there is no problem with game play even if the user refuses these requests for permission.
- In your built-Xcode project, uncompress the Permissions.zip file and drag and drop to the sub-directory 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.
- Add the title and explanation of the necessary permission in the available lists of Permission.strings. If you add fifteen language resources in your Xcode project and try 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).
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051"Header_Title" = "Access authority notice for gameplay";"Header_OK" = "OK";"Camera_Title" = "(Optional)Camera";"Camera_Description" = "This authority is required to use camera for profile settings in your game.";"Photos_Title" = "(Optional)Photo";"Photos_Description" = "This authority is required to upload photos to the profile in your game.";"Push_Title" = "(Optional)Push";"Push_Description" = "This authority is required to receive push messages from the game.";"AppleMusic_Title" = "Apple Music test for additional authority";"AppleMusic_Description" = "This content is to test additional authority for Apple Music.";"Common_Title" = "";"Common_Description" = "You can still use the service without agreeing to the optional permissions.";"Bluetooth_Title" = "";"Bluetooth_Description" = "";"Calendar_Title" = "";"Calendar_Description" = "";"Health_Title" = "";"Health_Description" = "";"Home_Title" = "";"Home_Description" = "";"Location_Title" = "";"Location_Description" = "";"Microphone_Title" = "";"Microphone_Description" = "";"Motion_Title" = "";"Motion_Description" = "";"Reminders_Title" = "";"Reminders_Description" = "";"Siri_Title" = "";"Siri_Description" = "";"SpeechRecognition_Title" = "";"SpeechRecognition_Description" = "";"TVProviderAccount_Title" = "";"TVProviderAccount_Description" = "";
Android
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 feature 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 resources for customization in advance. Refer to the following .gif files for using the resources.
- Android
- Cocos2d-x
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
<?xml version="1.0" encoding="utf-8"?> <resources> <string name="hive_permission_ui_title">Access authority notice for gameplay</string> <string name="hive_permission_ui_ok">OK</string> <!-- PermissionGroup 'PHONE' --> <string name="hive_permission_phone_title">(Optional)PHONE</string> <string name="hive_permission_phone_desc">The authority is required to use the device identifier when sending event rewards in the game./string> <!-- PermissionGroup 'CONTACTS' --> <string name="hive_permission_contacts_title">(Optional)CONTACTS</string> <string name="hive_permission_contacts_desc"></string> <!-- PermissionGroup 'STORAGE' --> <string name="hive_permission_storage_title">(Optional)STORAGE</string> <string name="hive_permission_storage_desc">The authority is required to use an external memory storage for additional downloads.</string> <!-- PermissionGroup 'LOCATION' --> <string name="hive_permission_location_title">(Optional)LOCATION</string> <string name="hive_permission_location_desc">The authority is required to access your location.</string> <!-- PermissionGroup 'MICROPHONE' --> <string name="hive_permission_microphone_title">(Optional)MICROPHONE</string> <string name="hive_permission_microphone_desc">This authority is required to use the microphone in your device.</string> <!-- PermissionGroup 'CAMERA' --> <string name="hive_permission_camera_title">(Optional)CAMERA</string> <string name="hive_permission_camera_desc">This authority is required to take pictures and record video clips.</string> <!-- PermissionGroup 'SMS' --> <string name="hive_permission_sms_title">(Optional)SMS</string> <string name="hive_permission_sms_desc"></string> <!-- PermissionGroup 'CALENDAR' --> <string name="hive_permission_calendar_title">(Optional)CALENDAR</string> <string name="hive_permission_calendar_desc"></string> <!-- PermissionGroup 'SENSORS' --> <string name="hive_permission_sensors_title">(Optional)SENSORS</string> <string name="hive_permission_sensors_desc"></string> <!-- PermissionGroup 'COMMON' --> <string name="hive_permission_common_title"></string> <string name="hive_permission_common_desc">You can still use the service without agreeing to the optional permissions.</string> </resources> |
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 } }]; |