MoEngage Android Integration Demo
Switch branches/tags
Clone or download
Pull request Compare This branch is 12 commits ahead of umangmoe:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app
gradle/wrapper
.gitignore
README.md
build.gradle
gradle.properties
gradlew
gradlew.bat
settings.gradle

README.md

MoEngage Android SDK Integration

This repository demonstrates integration of MoEngage's Android SDK with your Application, which includes:

  1. Adding dependency
  2. Initialise SDK
  3. Tracking Events
  4. Tracking user attributes
  5. Getting token from MoEngage
  6. Self handled in-app integration

Add dependency

  implementation 'com.moengage:moe-android-sdk:9.2.02'

Adding Lifecycle callbacks

Add the below line the Application class's onCreate()

  MoEngage moEngage =
                new MoEngage.Builder(this, "XXXXXXXXXXXXXXX")//enter your own app id
                   .setNotificationSmallIcon(R.drawable.icon)//small icon should be flat, pictured face on, and must be white on a transparent background.
                   .setNotificationLargeIcon(R.drawable.ic_launcher)
                   .enableLocationServices()//enabled To track location and run geo-fence campaigns
                   .build();
  
        MoEngage.initialise(moEngage);

Tracking Events

    //building event attributes
    PayloadBuilder builder = new PayloadBuilder()
        .putAttrDate("sign-up-date", new Date())
        .putAttrString("type", "user-pass");
    //sample track event
    MoEHelper.getInstance(getApplicationContext()).trackEvent("Sign Up", builder.build());