Quickly start up your Unreal integration with Leanplum
This article is your first step to activating the Leanplum Unreal SDK. Once completed, you will have access to all the goodness Leanplum provides. Follow the steps below.
The Leanplum Unreal SDK includes wrappers around the native iOS and Android SDKs.
The following matrix shows the features supported with each platform:
Feature | iOS | Android | Standalone |
---|---|---|---|
Data modeling | ✓ | ✓ | - |
Analytics | ✓ | ✓ | - |
In-app messaging | ✓ | ✓ | - |
Push notifications | ✓ | ✓ | - |
App Inbox | - | - | - |
Install the SDK
STEP 1: Download the Leanplum Unreal Plugin
Download the latest version of Unreal SDK from our Github repository. The repository also contains host application for testing purposes.
STEP 2: Import the Leanplum Unreal Plugin into your project
Copy the contents of Plugins/LeanplumSDK into your project folder under Plugins directory.

To enable the plugin, either modify project plugins and enable LeanplumSDK, or edit your project .uproject file and enable the SDK

A: Add app keys
Open your GameMode and copy your appId and clientKeys into the newly created variables. You can find these in App Settings and clicking Keys & Settings.

B: Edit level blueprint & Initialize the SDK
Open your level blueprint that opens first when your game starts to initialize the Leanplum SDK and call start method. You can customize the start call by providing User ID and User Attributes.

STEP 3: Run Your Build
Build and run your app and see data start flowing into Leanplum. With your development key in your app delegate, you will be able to see all data flowing into Leanplum in our debugger. You can access our debugger dashboard at https://leanplum.com/dashboard#/help/debug
STEP 4: Register Your Test Device
Registering your device as a test device will allow you to preview your messages, variable changes, and any other Leanplum projects. Follow the below to register. Visit https://leanplum.com/dashboard#/account/devices and click on "Register" to register your device
STEP 5: Complete Your Integration
Success! You have now successfully installed the Leanplum Unreal SDK and registered a test device for further testing. This is an exciting first step on the journey to full integration with Leanplum.
To complete your integration with Leanplum, check out the below articles to learn more about your user data, tracking with Leanplum, variables, importing data and setting up messages.
Push Notifications
To setup push notification support with your Unreal project, Leanplum provides a couple of built-in methods that will help you depending on the platform your game is played on.
iOS Setup
STEP 1:
You need to enable your iOS project for push notifications. To be able to do it you will have to compile the Unreal Engine from source and enable the Remote Notifications in Project Settings.
Refer to official Unreal Engine documentation here.
STEP 2:
You can ask the user to allow your app for remote notifications directly from Unreal. This is done by calling the below method from blueprints or C++ after Leanplum starts (Leanplum.start()). This will register the device through the iOS framework to receive alerts, badges, and sounds - it will directly show the native iOS prompt.
Note that you can use Push Pre-Permission instead of directly showing the native prompt.
UFUNCTION(BlueprintCallable, Category = "Leanplum")
static void RegisterForRemoteNotifications();
STEP 3:
For iOS push notifications to work with Leanplum, you'll also need to upload your .p12 certificates to Leanplum. Refer to the iOS SDK docs for instructions on how to do that.
If you want to use Rich Push Notifications follow the iOS guide on how to enable them.
To implement push notifications with your Unity Android project, you will need to follow the below steps:
Android Setup
STEP 1:
On Android, you can setup Firebase Cloud Messaging through Gradle.
STEP 2:
Go to the project folder -> Plugins -> LeanplumSDK -> Source -> LeanplumSDK. Open the LeanplumSDK_Android_UPL.xml file. Uncomment the Firebase dependencies.
implementation platform('com.google.firebase:firebase-bom:26.7.0')
implementation 'com.google.firebase:firebase-messaging'
STEP 3:
Set the desired firebase-messaging version.
STEP 4:
Add your google-services.json file to your project Config folder.
STEP 5:
Add the Google Server API key in the Leanplum App settings on the Dashboard
Test Push Notifications
Once you've set up push notifications, test that it is working properly by sending a push notification to your development devices.