Skip to content

Unreal iOS

After completing app development with the Hive SDK Unreal iOS, you need to configure the following items when building the app.

  1. In the Unreal Editor menu, clickEdit > Project Settings. The project settings window will appear on the screen.
  2. In the project settings window, select the iOS menu under the Platform title in the left panel. The iOS settings screen will appear. Set the items guided by each group.

Settings by group

Here are the group-by-group setting instructions.

  • Bundle Information group: Enter your game's AppID in the Bundle Identifier field.

  • OS Info group: Starting with Unreal Engine 4.25, the supported OS version has been changed to 11.0 or higher. Set the Minimum OSVersion field value to 11.0.

  • Build group: Enter -ObjC in the Additional Non-Shipping Linker Flags field and the Additional Shipping Linker Flags field.

Extra Plist Data group settings

Enter the code lines according to the setting items listed below in the Additional PList Data field. All the code below must be entered in one line.

Access permission request settings

To set access permission requests, add the following code to the Additional PList Data field.

<key>NSCameraUsageDescription</key>
<string>Approval required to take pictures.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Approval required to upload image files.</string>
<key>NSUserTrackingUsageDescription</key>
<string>We need your permission to use the Advertising Identifiers (IDFA) for promotion targeting and tracking analysis.</string>

Authentication: Facebook, QQ VK, WeChat, Line settings

If you are using Facebook, QQ, VK, WeChat, or Line authentication, add the following code to the Additional PList Data field to set the server whitelist.

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>weixin</string>
    <string>vk-share</string>
    <string>vkauthorize</string>
    <string>vk</string>
    <string>weixinULAPI</string>
    <string>fbapi</string>
    <string>fb-messenger-api</string>
    <string>fbauth2</string>
    <string>fbshareextension</string>
    <string>mqqOpensdkSSoLogin</string>
    <string>mqqopensdkapiV2</string>
    <string>lineauth2</string>
    <string>mqqopensdkapiV3</string>
    <string>wtloginmqq2</string>
    <string>mqq</string>
    <string>mqqapi</string>
</array>

When using Facebook, add the Facebook AppID and ClientToken using the following code. Be sure to enter the Facebook AppID and ClientToken values for your game.

<key>FacebookAppID</key><string>926000000000000</string>
<key>FacebookClientToken</key><string>d123783h7sdfyh8031h23unf81h3</string>

Set the URL Scheme for each IdP.

<key>CFBundleURLTypes</key>
<array>

<!--For Facebook usage. Please insert your app's Facebook App ID value-->
<dict><key>CFBundleTypeRole</key><string>Editor</string><key>CFBundleURLSchemes</key><array><string>fb926000000000000</string></array></dict>

<!--For using deep links on the Hive platform. Please insert your AppID value-->
<dict><key>CFBundleTypeRole</key><string>Editor</string><key>CFBundleURLSchemes</key><array><string>com.com2us.misample.normal.freefull.apple.global.ios.universal</string></array></dict>

<!--For Google Sign-in. Please insert the Google Sign-in key value of your app-->
<dict><key>CFBundleTypeRole</key><string>Editor</string><key>CFBundleURLSchemes</key><array><string>com.googleusercontent.apps.270000000000-0m7r8tb2co1q00000000000000000000</string></array></dict>

<!--For QQ Sign-in. Please insert the QQ key value of your app-->
<dict><key>CFBundleTypeRole</key><string>Editor</string><key>CFBundleURLName</key><string>tencent</string>
<key>CFBundleURLSchemes</key><array><string>tencent1106227203</string></array></dict>

<!--For Wechat Sign-in. Please insert the Wechat key value of your app-->
<dict><key>CFBundleTypeRole</key><string>Editor</string><key>CFBundleURLName</key><string>weixin</string><key>CFBundleURLSchemes</key><array><string>wx78176cf0c698c0f9</string></array></dict>

<!--For VK Sign-in. Please insert the VK key value of your app-->
<dict><key>CFBundleTypeRole</key><string>Editor</string><key>CFBundleURLName</key><string>vk6270065</string><key>CFBundleURLSchemes</key><array><string>vk6270065</string></array></dict>

<!--For Line Sign-in-->
<dict><key>CFBundleTypeRole</key><string>Editor</string>
<key>CFBundleURLSchemes</key><array><string>line3rdp.$(PRODUCT_BUNDLE_IDENTIFIER)</string></array></dict>

</array>

The following is an example of the values above inserted into the Additional PList Data field.

<key>NSCameraUsageDescription</key>
<string>Approval required to take pictures.</string>
<key>NSContactsUsageDescription</key>
<string>You must agree to add friends from your Contacts.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Approval required to upload image files.</string>
<key>NSUserTrackingUsageDescription</key>
<string>We need your permission to use the Advertising Identifiers (IDFA) for promotion targeting and tracking analysis.</string>
<key>FacebookAppID</key>
<string>1809615065921877</string>
<key>FacebookClientToken</key>
<string>c41e47ba5512ea3fb5bfb29d5cfeb244</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>line3rdp.$(PRODUCT_BUNDLE_IDENTIFIER)</string>
</array>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>fb926000000000000</string>
</array>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>com.com2us.hivesdk.normal.freefull.apple.global.ios.universal</string>
</array>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>com.googleusercontent.apps.331526026701-s41n272jsv6c0f72kt5o7of0jns350gl</string>
</array>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>tencent</string>
<key>CFBundleURLSchemes</key>
<array>
<string>tencent1106227203</string>
</array>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>weixin</string>
<key>CFBundleURLSchemes</key>
<array>
<string>wx78176cf0c698c0f9</string>
</array>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>vk6270065</string>
<key>CFBundleURLSchemes</key>
<array>
<string>vk6270065</string>
</array>
</dict>
</array>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>weixin</string>
<string>vk-share</string>
<string>vkauthorize</string>
<string>vk</string>
<string>weixinULAPI</string>
<string>fbapi</string>
<string>fb-messenger-api</string>
<string>fbauth2</string>
<string>fbshareextension</string>
<string>mqqOpensdkSSoLogin</string>
<string>mqqopensdkapiV2</string>
<string>lineauth2</string>
<string>mqqopensdkapiV3</string>
<string>wtloginmqq2</string>
<string>mqq</string>
<string>mqqapi</string>
</array>

Apple sign in settings

To support Apple SignIn, add the following code to theProject Folder > Config > DefaultEngine.ini file.

bEnableSignInWithAppleSupport=True

Multilingual settings

To service your app in multiple languages, you need to add multilingual setting files. Download the multilingual setting file, extract it, and copy the contents of the localize folder to /Plugins/HIVESDK/Source/HIVESDK/ThirdParty/iOS/resource.

Applying HIVEAppDelegate

For iOS builds, you need to modify the AppDelegate method. In the case of Unreal Engine, Swizzling is used to access the AppDelegate. Add the following code during the app initialization stage when the app starts.

// Add IOSAppDelegate.h
#if PLATFORM_IOS
#include "Runtime/ApplicationCore/Public/iOS/IOSAppDelegate.h"
#endif


// Add AppDelegate
#if PLATFORM_IOS
UIApplication * dummyApplication = [UIApplication sharedApplication];
Class clzHIVEAppDelegate = NSClassFromString(@"HIVEAppDelegate");
SEL selApplicationDidFinishLaunchingWithOptions = NSSelectorFromString(@"application:didFinishLaunchingWithOptions:");
if( clzHIVEAppDelegate != nil && [clzHIVEAppDelegate respondsToSelector:selApplicationDidFinishLaunchingWithOptions] ) {
NSMethodSignature *method = [clzHIVEAppDelegate methodSignatureForSelector:selApplicationDidFinishLaunchingWithOptions];
if (method != nil) {

    NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:method];
    [invocation setSelector:selApplicationDidFinishLaunchingWithOptions];
    [invocation setTarget:clzHIVEAppDelegate];
    [invocation setArgument:(void*)&dummyApplication atIndex:2];
    NSDictionary *localLaunchOptions = [IOSAppDelegate GetDelegate].launchOptions;
    if( localLaunchOptions != nil ) {
        [invocation setArgument:(void*)&localLaunchOptions atIndex:3];
    }
    [invocation invoke];
}
}
#endif

iOS FMallocAnsi settings

For the Unreal Engine iOS environment and the C++ standard template library to be compatible properly, FMallocAnsi settings are required as follows. Add the following code to the {YourProject}.Target.cs file in your app project.

public class YourProjectTarget : TargetRules
{
   public YourProjectTarget(TargetInfo Target) : base(Target)
   {  
       // Force execution of ANSI allocator for the game client
       if(Target.Platform == UnrealTargetPlatform.IOS)
       {
           GlobalDefinitions.Add("FORCE_ANSI_ALLOCATOR=1");
       }
   }
}