Skip to main content
In-App NATIV Campaigns target your users by showing a message while the user is using your app. They are very effective in providing contextual information and help to cross-sell/up-sell on desired screens of your app or/and on desired actions performed by the user in your app.
Inapp Native

Installing Android Dependency

Maven 3 Add the following dependency to the mainTemplate.gradle file.
replace $sdkVersion with the appropriate SDK version

Requirements for displaying images and GIFs in InApp

Starting InApp version 7.0.0, SDK requires Glide to show images and GIFs in the in-apps. You need to add the below dependency in your mainTemplate.gradle file.

Display In-App

Call the below API to show an in-app message on a screen.

Show Nudge

Use MoEInAppHelper.ShowNudge() to display a nudge-type in-app message at a specified position on screen.
The NudgePosition enum defines where the nudge appears:
ValueDescription
TopDisplays the nudge at the top of the screen.
BottomDisplays the nudge at the bottom of the screen.
BottomLeftDisplays the nudge at the bottom-left corner.
BottomRightDisplays the nudge at the bottom-right corner.

Self-Handled InApps

Self-handled In-Apps are messages that the SDK delivers to the application, and the application builds the UI using the SDK’s delivered payload.

Single Self-Handled InApps

Call the below API to request a single self-handled in-app message.
The payload is returned via a callback. Register a callback as shown below.

Multiple Self-Handled InApps

Event-triggered multiple self-handled in-apps are not supported.
Use MoEngageClient.GetSelfHandledInApps() to fetch multiple self-handled campaigns. The SDK returns up to 5 campaigns in the order of campaign priority set at the time of campaign creation.
The list of campaigns is returned via a callback. Register a callback as shown below.

Tracking Statistics

The statistics for each campaign in the list must be tracked individually. Pass the individual InAppSelfHandledCampaignData object as a parameter to the APIs below.

InApp Callbacks

SDK provides callbacks to the client application whenever is shown, dismissed or clicked(only if there is a navigation action or custom action associated with the widget).
Use the below callbacks to get notified for the above cases

InApp Shown

InApp Clicked

InApp Custom Action

InApp Dismissed

InApp Payload

Handling Orientation Change

This is only for the Android platform
Starting Unity Plugin version 2.2.0 in-apps are supported in both portrait and landscape modes.
SDK has to be notified when the device orientation changes for SDK to handle in-app displays.
There are two ways to do it:
  1. Add the API call in the Android native part of your app
  2. Call MoEngage plugin’s onOrientationChanged()
  3. Add the API call in the Android native part of your app
Notify the SDK when onConfigurationChanged() API callback is received in your UnityPlayerActivity class.
If you don’t want to create a custom UnityPlayerActivity, MoEngage SDK on Android comes bundled with MoEUnityPlayerActivity which internally handles the device configuration changes.
This activity needs to be added as an entry point to your app, to do so replace your current entry point with the below code in your AndroidManifest.xml.

Call the MoEngage plugin’s orientation change API

Call the below API to notify SDK of the orientation change.