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.

Self Handled In-Apps

Self Handled In-Apps are messages that are delivered by the SDK but showing has to be done by the App.
To show In-Apps call the below method.
The payload for self-handled in-app is returned via a callback. Register a callback as shown below.

Tracking Statistics

Since display, click, and dismiss for Self-Handled InApp is controlled by the application we need you to notify the SDK whenever the In-App is Shown, Clicked, or Dismissed. Below are the methods you need to call to notify the SDK. The InAppSelfHandledCampaignData object provided to the application in the callback for self-handled in-app should be passed in as a parameter to the below APIs.

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.