Unreal Engine SDK

1. Unreal Engine Compatibility

This SDK is compatible with Unreal Engine 4.10 ~ 4.22.

Android Platform Requirements:
* Android 2.3 and above.

iOS Platform Requirements:
* iOS 6.1 and above.
* Confirmed correct operation when using remote builds under Unreal Engine 4.20 or 4.22.

2. Unreal Engine Project SDK Integration

Step1: Smartbeat Plugin Integration

Download SmartBeat SDK from below.

Decompress SmartBeat-UE4.zip and move the SmartBeat folder to the project’s Plugins folder. (Create the Plugins folder if it does not already exist)

After completing the above step, the first time opening the project in Unreal Editor, a dialog like the one shown below will be shown. Click yes to build the project.

The plugin will not be build properly when embedded in a Blueprint only project without C++ support. From the Unreal Editor menu, select File > New C++ Class... and add a C++ class. Selecting "None" as the type and adding the class with the default name is sufficient. After adding the C++ class, re-open the project.
* If the project was initially created with C++ support, adding a new C++ class is unnecessary.

Step2: Set API key

From the Unreal Editor toolbar select Settings > Project Settings... > Project Settings.

On the Plugins - SmartBeat page, below the IOS/Android title, find the API Key input box, and enter the API Key from the SmartBeat Console.

Step3(Only for Android): Duplicate user count prevention

There are no settings needed.
※ Unreal Engine utilizes the GooglePlayService so this feature is automatically enabled.
※ This only works for the users whose device is using Google Play services 4.0 and above (Otherwise, users are counted as before).

Step4(Only for Android): Enabling SIGNAL handling

To enable SIGNAL handling, modify the Unreal Engine source (Engine/Source/Runtime/Core/Private/Android/AndroidMisc.cpp) as shown below.

const int32 TargetSignals[] =
{
    SIGQUIT, // SIGQUIT is a user-initiated "crash".
    //Commented to enable SmartBeat error handling
    //SIGILL,
    //SIGFPE,
    //SIGBUS,
    //SIGSEGV,
    SIGSYS
};

Step3(Only for iOS): Duplicate user count prevention

※ The following items are required for Unreal Engine projects running on iOS.

By enabling this feature, it is possible to identify a single user even if the user repeatedly uninstalls and re-installs (a.k.a "reset marathon"). That means it is possible to avoid unexpected increases of MAU.

The Audience feature is enabled by using the "Duplicate User Count Prevention" functionality.
※ This only works for iOS 6.0 and above users

If you don't enable this feature, you can skip the following steps.

Add linker flags

From the Project Settings > Platform - iOS page, set the following under the “Additional Shipping Linker Flags” item.

-force_load "Project Path /Plugins/SmartBeat/Lib/IOS/libSmartBeatIdfa.a"


※ Unreal Engine 4.10 doesn’t correctly apply Additional Shipping Linker Flags, so even after entering the above setting correctly, the duplicate user count feature will not function.

Step4(Only for iOS): Remote Build Settings for UE 4.21 and later

※ This item is required for builds targeting iOS via remote build from Windows utilizing UE 4.21 and later.

Place the following content in the file located at //Build/Rsync/RsyncProject.txt

+ Plugins/SmartBeat/Lib/IOS/**

3. Extra functions

3.1 Include LogCat/NSLog

Extracting and sending crash data to the SmartBeat server in the event of a native layer (Objective-C/C++ for iOS, Java/C++ for Android) crash.
※ The most recent 64KB or 500 lines of log will be included in crash reports.
※ Errors which occur in the Blueprint layer are not included in LogCat/NSLog.
※ As of iOS 10, even if enabled, this section's NSLog feature will not function.

How to activate

From the Project Settings > Plugins - SmartBeat page, enable the options “Enable NSLog” (for iOS) or “Enable Logcat”. (for Android)

3.2 Logging

Blueprint layer logs are included in crash data sent to the SmartBeat server.
※ The most recent 64KB or 500 lines of log will be included in crash reports.

How to activate

From the Blueprint Graph Editor’s context menu, add the SmartBeat > Log for SmartBeat node.

In the node’s “Message” field, set the log message.

3.3 Set user identifier

If your application provides a user ID for each user, you can include it with crash/exception data. That help you find specific user’s errors by using this user ID on the SmartBeat web console.

How to activate

From the Blueprint Graph Editor’s context menu, add the SmartBeat > Set User ID for SmartBeat node.

In the node’s “User ID” field, set the user ID.

3.4 Add Extra data

You have another option to add extra custom information into the crash/exception reports. This will help you reproduce and fix errors. (e.g. user’s entering parameters, API return values etc.)

How to activate

From the Blueprint Graph Editor’s context menu, add the SmartBeat > Add Extra Data for SmartBeat node.

In the node’s “key” and “value” fields, set the key and value.

The values will be overwritten by new one which has the same key.

3.5 Breadcrumb function

You can know what the user did by adding breadcrumbs at any point.

How to activate

From the Blueprint Graph Editor’s context menu, add the SmartBeat > Leave Breadcrumb for SmartBeat node.

In the node’s “Breadcrumb” field, set the breadcrumb content.

Only last 16 breadcrumbs are saved and displayed on SmartBeat console. If you leave breadcrumbs when the screen transition (like :Map screen -> Game screen -> Setting screen), you can know the screen transition history just before the error occurred.

3.6 Disabling crash/exception report by default

It’s possible to start with error capture disabled, and enable error capture at a later time.

How to activate

From the Project Settings > Plugins - SmartBeat page, use the “Disable at Startup” to control whether SmartBeat is enabled or disabled when the app starts.

To later enable Smartbeat, add the SmartBeat > Enable Smartbeat node from the Blueprint Graph Editor’s context menu. After the Enable SmartBeat node runs, error capture will be enabled.

3.7 Audience function

By using the Advertising ID for Android or IDFA for iOS, it's possible to understand the gender and age distribution of your users.

How to activate

The Audience feature is enabled by using the "Duplicate User Prevention" functionality. Please see details regarding the settings for Duplicate User prevention here( android / iOS ).