Skip to main content

Overview

This guide covers the parameters you can use to configure the MoEngage SDK. All plugin-level configuration is done within your app.json or app.config.js file. Core SDK credentials are placed in separate platform-specific files.
You must complete the installation guide before you configure the SDK.

Plugin-Managed Native Configuration

To ensure a reliable and streamlined setup, the MoEngage Expo plugin manages native project configurations automatically. This approach reduces the potential for manual errors by handling platform-specific requirements during the prebuild process. Key automations include:
  • Applying Critical Settings: The plugin automatically adds required settings, such as the Android backup exclusion rules, to ensure data integrity.
  • Eliminating Manual File Edits: Direct modification of native files like AndroidManifest.xml (for Android) or Info.plist (for iOS) is not necessary.

SDK Initialization Configuration (XML and Plist files)

As specified in the configFilePath property, your core MoEngage credentials and SDK settings do not go in app.json. Instead, they are defined in separate files for each platform.
  • For Android: Generate an XML file (e.g., android_initialisation_config.xml).
  • For iOS: Generate a Plist file (e.g., MoEngage-Config.plist).
The following tables detail the available properties for these files.
Android SDK Configuration

Configuration parameters

Add the properties listed below inside the react-native-expo-moengage plugin entry in your app.json or app.config.js file. These parameters control the plugin’s build-time behavior, such as linking native modules and pointing to your configuration files.
  1. Open your app.json or app.config.js file.
  2. Add react-native-expo-moengage to the plugins array.

Configure iOS App Extensions with EAS Build

EAS Build automatically handles standard iOS app configurations. However, if your app uses features that require separate native targets, you must configure them in eas.json. This includes features like:
  • Notification Service Extensions (NSE): used for rich push and impression tracking.
  • Notification Content Extensions (NCE): used for Push templates or Live Activities.
To configure iOS app extensions, add the appExtensions key to the expo.extra.eas.build.experimental.ios object. This configuration ensures EAS Build can correctly compile and sign the additional native targets.

Generate the native project files

After installing the package and adding the plugin entry, you must run the prebuild command. This command uses your configuration to generate the native Android and iOS directories for your project. Run the following command:

Next steps

After you’ve added your configuration, the final step is to initialize the SDK in your app’s code.