This page informs you how to develop games based on Unreal Engine; porting Hive SDK, or building as Android, iOS, or Windows apps.

Prerequisites

This guide is based on the following environment.

Android

  • Hive SDK v4 UE4 Android+iOS 23.0.0
  • Unreal Engine 4.27 Plus
    • commit hash: e672ada6986ef0eb7e2d94e7f7b7fbd7ac491b27
  • JDK 8
  • AndroidStudio 4.1
  • Android NDK r21
  • Android SDK min version 21
  • Android SDK target version 34

iOS

  • Hive SDK v4 UE4 Android+iOS 23.0.0
  • Unreal Engine 4.27 Plus
    • commit hash: e672ada6986ef0eb7e2d94e7f7b7fbd7ac491b27
  • Xcode 15.1+
  • iOS Version 12.0+
  • macOS Ventura 14+

Windows

  • Windows 10+
  • Unreal Engine 4.27

Porting

To develop apps based on Unreal Engine, port Hive SDK as plugin type to Unreal Engine development environment. As following description, add Hive SDK to the development environment and execute necessary setup and coding.

  1. Build Unreal Engine
  2. Adding Hive SDK to Unreal Editor as Plugin Type
  3. Editing Unreal Engine File
  4. General Settings
  5. Hive Settings

Build Unreal Engine

Refer to Prerequisites and download Unreal Engine source codes and build it.

Activate the Rosetta emulator for macOS

You need to use the Rosetta emulator on the Apple Silicon CPU-installed macOS development machine. Check Product > Destination > Destination Architectures > Show Rosetta Destinations on Xcode.

Adding Hive SDK to Unreal Editor

Add the Hive SDK as a plugin to Unreal Editor. If you do not have the Hive SDK for Unreal Engine, download the Hive SDK for Unreal Engine from SDK download page.

If you already downloaded the Hive SDK for Unreal Engine, follow the instructions below to add the Hive SDK as a plugin to the Unreal Editor:

  1. Unzip the Hive SDK for Unreal Engine downloaded from Hive developers site, and copy all the items in the Plugin folder from the unpacked files to the Plugins folder under the root folder of your Unreal Engine game project.
  2. Add "HIVESDK" to the parameter of PublicDependencyModuleNames.AddRange() method, which is implemented within the <Project_route>;/Source/<Project_route>;/<Project_name>;build.cs file, as the following example code. Replace with your actual project name.

Editing Unreal Engine File

If you use Unreal Engine 4.25.4 and later, delete or edit the Unreal Engine file as follows.

Android

When the screen orientation is set to both directions (both horizontal and vertical) in the game build, the code below needs to be modified for the screen auto-rotation.

  • Go to the /Engine/Build/Android/Java/src/com/epicgames/ue4/GameActivity.java.template.

  • Add the HiveActivity.onConfigurationChanged() API.

A compatibility issue exists between the Google Billing Library version 5 used by the Hive SDK and the Google Billing features built into Unreal Engine, causing the build to fail. Modify the code below to fix this issue.

  • Go to the /Engine/Plugins/Online/Android/OnlineSubsystemGooglePlay/Source/OnlineSubsystemGooglePlay.Build.cs

  • Comment out the following code

To use the Singular external library included in the Hive SDK, the files below needs to be modified.

  • Go to the /Engine/Build/Android/Java/src/com/android/vending/licensing

  • Delete the following files.

    • ILicensingService.aidl
    • ILicenseResultListener. aidl
  • iOS

    Since the Hive SDK for iOS is developed in Swift, some modifications are required for the compatibility between Unreal Engine and Swift, and the modification of Unreal Engine is also required to use the notification feature provided by the Hive SDK.

    In the files below, add the lines marked with 'Add' comment.
     

    Engine/Source/Runtime/ApplicationCore/Public/IOS/IOSAppDelegate.h

     

    Engine/Source/Runtime/ApplicationCore/Private/IOS/IOSAppDelegate.cpp

      When applying Hive SDK v4.15.2.2 or higher, implement application(_:supportedInterfaceOrientationsFor:) method in the IOSAppDelegate.cpp file from Unreal Engine to activate the Configuration of Screen Orientation feature on iOS. 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.

      • Add the following code to /Engine/Source/Runtime/ApplicationCore/Private/IOS/IOSAppDelegate.cpp.

     

    If you are using Unreal Engine 4.27 Plus and Hive SDK v4.16.3 (Xcode 14.1 or higher) version, add the 'Add' commented line in the files below.
     

    Engine/Source/Programs/UnrealBuildTool/ProjectFiles/Xcode/XcodeProject.cs

     

    Engine/Source/Programs/UnrealBuildTool/Platform/IOS/IOSToolChain.cs

     

    Universal Link Settings
    • From Hive SDK v4.15.8, Universal Link, not a URL scheme, enables you to install and run an app and reward invitees on the invite page.
    • For more information about the additional console settings for creating invitee links based on Universal Link, see the Operation > Promotion guide from Hive Developers.

    In the files below, add the line commented with 'Add'.
     

    Engine/Source/Programs/UnrealBuildTool/Platform/IOS/IOSExport.cs

    General Settings

    Android
    1. Click Edit >; Project setting menu of Unreal Editor. Project setting screen will show up.
    2. Select Android SDK from the Platforms list. Then you can set the Android version on the Android SDK Setting screen as described below.
      • Input android-30(Hive SDK v4.15.1+) and higher in the SDK API Level field.
      • Input android-21 in the NDK API Level field.

    3. Select Android from the Platforms list. Then, you can set the fields of APKPackaging section as described below.
      • Input AppID of the game in the blank of Android Package Name field.
      • Input the app version Store Version: Input the app version shown in Google Play Store. View more information about app version
      • Set the Minimum SDK Version as 21 and higher. Even if you set it as under 21, it will be automatically changed as 21 by Unreal Engine operating.
      • Set the Target SDK Version as 30(Hive SDK v4.15.1+) and higher.

    Google and Google Play Games Sign-in support

    Hive SDK supports both Google sign-in (iOS, Android) and Google Play Games sign-in (Android). To use Google Play Games sign-in, you first need to modify the Unreal Engine codes as below.

    1. Open ./Engine/Build/Android/Java/src/com/epicgames/ue4/GameActivity.java.template.
    2. Remove the following line.

    To use Google or Google Play Games sign-in, select “GOOGLE” or “GOOGLE_PLAY_GAMES” ProviderType and call AuthV4.SignIn().

     

    iOS
    1. Click Edit > Project setting on the Unreal Editor menu. Project setting window will show up.
    2. Select the iOS from the Platforms list. Then, you can set the fields as described below on the setting screen.
      • Bundle Information group: Input AppID of the game in the blank of Bundle Identifier field.
      • OS Info group: Unreal Engine 4.25 supports OS 11.0 and later. Set the value of Minimum OSVersion field as 11.0.
      • Build group: Input -ObjC in the Additional Non-Shipping Linker Flags field and Additional Shipping Linker Flags field.
      • Extra PList Data group: Input the following codes in the Additional PList Data field.
      • Access permission request settings
      • When using Facebook, QQ, VK, WeChat or Line, add the following codes to set Whitelist on the server:
      • When using Facebook, utilize the following code to add a Facebook AppID and a ClientToken. Make sure to enter the Facebook AppID and ClientToken of your games.
      • Set the URL Scheme.
      • Following is an example entering all values above into the Additional PList Data field:
    3. Add the following codes to the DefaultEngine.ini file in the Project > Config directory to use Apple Sign-in.

     

    Add Firebase Analytics
  • After registering the app in the Firebase console (https://firebase.google.com/), put the issued GoogleService-Info.plist file under the following path.

    /Plugins/HIVESDK/Source/HIVESDK/ThirdParty/iOS/resource

  • Apply language configuration file
  • In order to apply multiple languages, you need to add a language configuration file.
    • Please copy all the files in the localize folder of configuration file and paste them into the following path.

      /Plugins/HIVESDK/Source/HIVESDK/ThirdParty/iOS/resource

  • Apply HIVEAppDelegate
  • For iOS builds, the AppDelegate method needs to be modified. In Unreal Engine environment, please use the Swizzling to access AppDelegate.
    Add the code below at the initialization stage when starting the game.
  •  

    Configure iOS FMallocAnsi

    FMallocAnsi settings are required for proper compatibility between the Unreal Engine iOS environment and the C++ standard template library.

    Add the following codes to the {YourProject}.Target.cs file in your game project.

    Windows
    Plugin Configuration

    Overwrite the contents of Plugin/HIVESDK to an existing Hive SDK project applied Unreal Engine plugin.

     

    Apply updated C++ interface

    Call SDK Plugin API

    • A replacement API call is required for some APIs because of crashes when calling the plugin interface applied an STL.
    • The class and the array(such as std::vector) return to a string of the JSON object and array (respectively).
    • The following is an example of calling the AuthV4::getPlayerInfo() API.
    • The following is a list of added APIs:
    • See the HIVESDKSampleUtility.cpp file to learn about a sample code for bypassing crashes when calling the toString() method of the class that includes in Promotion.h.

     

    Changed classes

    1. In the AppInvitationCampaign class,
      follow the sample code below for the change above.
    2. Add HiveStore = 15 to hive::IAPV4Type.
    3. Add ErroCode:IAPSUCCESS = 90 and Code:IAPV4HiveStoreSuccess = -6110000 to Result API.
    4. In the ConflictSingleViewInfo class,
    5. In the ConflictViewInfo class,

     

    API for Windows build

    • Refer to the sample project, PlayerTestView.cpp, and learn about the Activate/Deactivate the IME(Input Method Editor) of the calling the API above when calling the AuthV4::showInquiry, AuthV4::showMyInquiry, AuthV4::showDeviceManagement, AuthV4ShowChatbotInquiry, and AuthV4::showProfile API(for Windows).
      • The code below should be added before and after calling the SDK API.

      • HIVESDKIMEEnable and HIVESDKIMEDisable run on applying the engine modification(deactivating the TSF input method).
      • From Hive SDK 4.15.7, HIVESDKCEFImeEnable and HIVESDKCEFImeDisable run without modifying an engine.

     

    The followings are added to the Result API error code (Hive SDK v4.15.7+):

    • Enum code of ResultAPI class in the HIVE_ResultAPI.h file

     

    Pre-build Setup
    1. Refer to here to avoid duplicate running. You can also apply another method corresponding to your project.
    2. You need to modify an engine to the SDK functions normally (fix bootstrappakage).
      Modify the Unreal Engine source code and build.

      • The game name parameter is removed when running the executable file located in binaries among the executable files of the bootstrappakage.
        • After:
          Before modification swprintf(ChildCmdLine, ChildCmdLineLength, L”\”%s\\%s\” %s %s”, BaseDirectory, ExecFile, BaseArgs, CmdLine);
        • After:
          After modification swprintf(ChildCmdLine, ChildCmdLineLength, L”\”%s\\%s\” %s”, BaseDirectory, ExecFile, CmdLine);
      • Build the BootstrapPackagedGame project in your UE4 solution after modification
    3. Modify appid, zone, and provider id to be matched with your project on the hive_config.xml file located Plugins/HIVESDK/Source/HIVESDK/ThirdParty/windows/config/.

    Hive Settings

    Configure the setting items to utilize Hive in accordance with the following instructions. If you change the settings, the values of Unreal Editor is automatically saved, and the files saving setting values (hive_config.xml, etc_string.xml and GooglePlayAppID.xml) save the changes automatically. If the file of setting value does not exist, Hive SDK automatically generate it and save at the following route:

    • Android:
      <Project_Root folder>;/Plugins/HIVESDK/Source/HIVESDK/ThirdParty/android/resource/res/raw
    • iOS:
      <Project_Root folder>;/Plugins/HIVESDK/Source/HIVESDK/ThirdParty/iOS/resource/

    Follow the instructions below to set the values necessary for Hive:

    1. Click Edit >; Project Settings in the menu on Unreal Editor. Project Settings screen will show up.
    2. On the left panel of the project settings page, click HIVEConfig XML menu below the title, Plugin. Then HIVEConfig XML settings screen will show up.
    3. Replace the setting items as following instruction in the HIVEConfig XML screen.:
      • Input Facebook AppID of the game in the blank of Facebook App ID field in the Facebook Settings group. If you do not know the Facebook AppID, read Prerequisites.
      • Input Google Play Game Service AppID received from GAMEVIL or Com2uS in the blank of Google Play App ID field in the Google Play Settings group.
      • HiveConfig Settings group: Among setting values in the hive_config.xml file, followings are available to configure.
      • HiveConfig Mobile App Tracking Settings: Input the setting value for the marketing attribution to be used. Input the value of AppID, key or token issued from the marketing attribution dashboard.
        View the Marketing Attribution Settings Guide
      • WriteExternalStoragePermission: The value required by Android to request a permission to access external storage to users or not. If checked, Hive Client requests access permission to external storage to users when initializing Hive SDK.

    Applying Hive Features Selectively (Android, iOS)

    To selectively apply the Hive features needed for authentication, analytics, and more, follow these instructions:

    1. Select Unreal Editor > Edit > Project Settings.
    2. In the Project Settings left panel, choose Hive SDK > Dependency – Android/iOS.

    3. Choose the desired features in the Hive SDK Dependency screen. Some features may conflict with Unreal Engine settings, so refer to Modify Unreal Engine Files and General Settings for guidance on selecting the features to use.

    Building

    Follow the rules by OS below to utilize Unreal Engine development environment.

    Building Android Apps

    Build Settings

    If the version of Unreal Engine you use is 4.0 and later, set the items necessary to distribute your apps on Google Play Store as following instructions:

    • Setting Signing Key:
        1. Click Edit >; Project Settings in the menu on Unreal Editor. Project Settings screen will show up.
        2. On the left panel of the project settings page, click Android menu below the title, Platform. Then Android settings screen will show up.
        3. Input the Signing Key data in the field of Distribution Signing group on Android settings screen.

    • Packaging settings:
        1. On the left panel of the project settings page, click Packaging menu, below Project title. Then Packaging settings screen will show up.
        2. Check the For Distribution field of Project group in the packaging settings screen.

    Building

    How to build Hive-porting games for Android is the same with how to build general game apps for Android. Utilize File >; Project Packaging >; Android menu in the Unreal Editor.

    For more information about how to build, see Unreal Engine Guidelines.

    Building iOS Apps

    How to build Hive-porting games for iOS is the same with how to build general game apps for iOS. Utilize File >; Project Packaging >; iOS menu in the Unreal Editor.

    For more information about how to build, see Unreal Guidelines.

    Build for Windows

    • When packaging your project on the Unreal engine editor, select Windows (64-bit).
    • Retry to build even when occurs an error as below on the first build, then the project builds as expected.
      UATHelper: Packaging (Windows (64-bit)): Exception: ‘Access to the path ‘\Binaries\Win64\OpenImageIO_Util.dll‘ is denied.
      UATHelper: Packaging (Windows (64-bit)): ERROR: Exhausted all retries!

    After the build is completed, you need to modify the ProductVersion and FileVersion of the executable by using the Plugins/HIVESDK/Source/HIVESDK/ThirdParty/windows/util/rcedit.exe file or with another method.
    The following image shows the example of the script file that the versions are modified. 
     

    In an environment other than the developer PC, you need a Redistributable package.
    (See Latest Supported Visual C++ Redistributable Downloads)