
Installing Android Dependency
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
UseMoEInAppHelper.ShowNudge() to display a nudge-type in-app message at a specified position on screen.
NudgePosition enum defines where the nudge appears:
| Value | Description |
|---|---|
Top | Displays the nudge at the top of the screen. |
Bottom | Displays the nudge at the bottom of the screen. |
BottomLeft | Displays the nudge at the bottom-left corner. |
BottomRight | Displays 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.Multiple Self-Handled InApps
Event-triggered multiple self-handled in-apps are not supported.
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.
Tracking Statistics
The statistics for each campaign in the list must be tracked individually. Pass the individualInAppSelfHandledCampaignData 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
SDK has to be notified when the device orientation changes for SDK to handle in-app displays. There are two ways to do it:
- Add the API call in the Android native part of your app
- Call MoEngage plugin’s onOrientationChanged()
- Add the API call in the Android native part of your app
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.