Android — MoEngage Integration

Integrate MoEngage self-handled in-app campaigns into your Digia-powered Android app using the digia-moengage Android library.

The digia-moengage Android library bridges MoEngage self-handled in-app campaigns into Digia's Jetpack Compose rendering engine. When MoEngage triggers a campaign, this plugin intercepts the payload and renders the experience using a layout you designed in Digia Studio.

Artifact: com.github.Digia-Technology-Private-Limited:digia_moengage Version: android.1.0.0-beta.2 Platform: Android Min SDK: 21


How It Works

MoEngage Campaign Trigger


[MoEngage Android SDK]
        │  SelfHandledAvailableListener

[digia-moengage]
        │  maps payload → InAppPayload

[digia_engage runtime]
        │  SHOW_BOTTOM_SHEET / SHOW_DIALOG  → DigiaHost renders overlay
        │  SHOW_INLINE                      → DigiaSlot renders inline

Campaign UI (native Compose widgets from Digia Studio)

Prerequisites

  1. MoEngage account with your project configured. See MoEngage Docsarrow-up-right.

  2. Digia Studio account with campaign pages designed.

  3. digia_engage Android SDK already set up. See Digia Engage — Android.

  4. MoEngage Android SDK integrated. See MoEngage Android Integrationarrow-up-right.


Installation

1. Add JitPack repository

In your root settings.gradle.kts (if not already added for digia_engage):

2. Add dependencies


Integration

1. Initialize MoEngage, Digia, and Register the Plugin

Do this in your Application.onCreate(), in order:

2. Set Up DigiaHost

Wrap your root composable with DigiaHost so overlay campaigns (bottom sheets, dialogs) can be rendered above all content:

3. Add DigiaSlot for Inline Campaigns

Place DigiaSlot composables at positions in your screens where inline campaign content should appear. The placementKey must match the placement ID set in the Digia dashboard.

4. Screen Tracking

Forward screen changes to Digia so MoEngage can evaluate screen-based campaign trigger rules:


Creating Campaigns in MoEngage

In your MoEngage dashboard, create an in-app campaign and set the template type to Self Handled. In the campaign payload JSON, specify what Digia should render.

Nudges (Bottom Sheet or Dialog)

Inline Content (Cards & Banners)

Field
Required
Description

type

Yes

SHOW_BOTTOM_SHEET, SHOW_DIALOG, or SHOW_INLINE.

viewId

Yes

Slug of the Digia Studio page. See Finding Slugs.

placementId

Inline only

Must match the DigiaSlot placementKey in your composable.


MoEngagePlugin Lifecycle

MoEngagePlugin implements DigiaCEPPlugin. Digia manages the full lifecycle automatically after Digia.register(...).

Method
Called By
Description

setup(delegate)

Digia.register(...)

Registers SelfHandledAvailableListener with MoEngage.

forwardScreen(name)

Digia.setCurrentScreen

Calls setInAppContext on MoEngage and fetches campaigns for the new screen.

notifyEvent(event, payload)

DigiaHost / DigiaSlot

Dispatches impression, dismiss, and click events back to MoEngage.

teardown()

Digia.register(newPlugin)

Removes the listener and clears cached campaigns.

healthCheck()

Diagnostics

Returns whether the plugin is healthy (delegate is set).


Troubleshooting

Campaign not rendering

  • Verify Digia.initialize(...) is called before Digia.register(...).

  • Ensure the MoEngage campaign template is set to Self Handled.

  • Confirm viewId in the payload matches the page slug exactly (case-sensitive).

  • For inline campaigns, verify placementId matches the DigiaSlot placementKey.

  • Check that DigiaHost wraps the root composable for overlay campaigns.

Build errors

  • Ensure JitPack is added to your settings.gradle.kts repositories.

  • Confirm all dependency versions are compatible with your min SDK (21).


Dependency Reference

Artifact
Version
Role

com.github.Digia-Technology-Private-Limited:digia_engage

android.1.0.0-beta.2

Digia CEP rendering engine

com.github.Digia-Technology-Private-Limited:digia_moengage

android.1.0.0-beta.2

MoEngage CEP plugin for Digia

com.moengage:moe-android-sdk

your version

MoEngage Android SDK


Next Steps

Last updated