Mapp Engage SDK Setup and App Manifest Configuration

Prev Next

To start using Mapp Engage for your app, you’ll need to install the Mapp Engage SDK and update your app’s manifest accordingly. Follow the steps below to configure your Android app.

Procedure

Step 1: Add Required Data to the Android Configuration File

In your Android configuration file, include the following details:

  • CEP_URL: The Jamie URL used for caching and delivering in-app messages.

  • SDK Key: This unique key is generated in Mapp Engage Channel Management for each app. If you have multiple apps (e.g., Android development, Android production, iOS development, iOS production), each app will have its own SDK Key. Find this under Administration > Channels

  • APP_ID: The unique ID for each app, available in Mapp Engage Channel Management. Similar to the SDK Key, each app (Android/iOS) will have its own App ID.

  • TENANT_ID: The ID of your Mapp Engage system. This will be provided by your Mapp Cloud account manager or project manager.

  • Google Project ID: The ID of your Google Project, required for push notifications.

class AndroidAdvancedTestApplication : Application() {
  
   override fun onCreate() {
       super.onCreate()
       ...
  
       val opt = AppoxeeOptions()
       opt.sdkKey = SDK_KEY
       opt.googleProjectId = GOOGLE_PROJECT_ID
  
       //(optional for SDK 6.0.0 and above)
       opt.cepURL = CEP_URL
  
       opt.appID = APP_ID
       opt.tenantID = TENANT_ID
  
       //Only for version 5.0.10+
       opt.notificationMode = NotificationMode.BACKGROUND_AND_FOREGROUND
  
       //for SDK 6.0.0 and above
       opt.server = AppoxeeOptions.Server.EMC
  
       Appoxee.engage(this, opt)
  
       //This line is necessary for Android Oreo and above
       Appoxee.instance().receiver = MyPushBroadcastReceiver::class.java
  
       //Necessary for applications with locked screen rotation.
       Appoxee.setOrientation(this, ActivityInfo.SCREEN_ORIENTATION_PORTRAIT)
  
       //Registered users are opt-outed by default.
       Appoxee.instance().isPushEnabled = true
   }
}
public class AndroidAdvancedTestApplication extends Application {
  
   @Override
   public void onCreate() {
       super.onCreate();
       ...
  
       AppoxeeOptions opt = new AppoxeeOptions();
       opt.sdkKey = SDK_KEY;
       opt.googleProjectId = GOOGLE_PROJECT_ID;
  
       //(optional for SDK 6.0.0 and above)
       opt.cepURL= CEP_URL;
  
       opt.appID = APP_ID;
       opt.tenantID = TENANT_ID;
  
       //Only for version 5.0.10+ (optional)
       opt.notificationMode = NotificationMode.BACKGROUND_AND_FOREGROUND;
        
       //for SDK 6.0.0 and above
       opt.server = AppoxeeOptions.Server.EMC;
  
       Appoxee.engage(this, opt);
        
       //This line is necessary for Android Oreo.
       Appoxee.instance().setReceiver(MyPushBroadcastReceiver.class);
        
       //Necessary for applications with locked screen rotation.
       Appoxee.setOrientation(this, ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
        
       //Registered users are opt-outed by default.
       Appoxee.instance().setPushEnabled(true);
   }
}

Step 2: Register MyPushBroadcastReceiver in Your App Manifest

Update your app manifest to register the MyPushBroadcastReceiver class, ensuring your app can handle push notifications:

<receiver
   android:name=".MyPushBroadcastReceiver"
   android:enabled="true"
   android:exported="false">
   <intent-filter>
       <action android:name="com.appoxee.PUSH_OPENED" />
       <action android:name="com.appoxee.PUSH_RECEIVED" />
       <action android:name="com.appoxee.PUSH_DISMISSED" />
   </intent-filter>
</receiver>

This registration ensures that your app can properly handle opened, received, and dismissed push notifications.

With these steps completed, your app will be properly configured to handle push and in-app notifications via the Mapp Engage SDK.