Overview
Custom Event Triggers provide marketers with a powerful tool to display in-app messages at the most relevant times for app users. Supported in iOS and Android SDKs v5.0+, these triggers allow dynamic targeting based on user behavior or app interactions.
Custom Event Triggers enable marketers to:
Show messages when users perform actions such as:
Adding items to a cart.
Opening specific pages within the app.
Adding items to a wishlist.
Collaborate with developers to define event triggers tailored to app behavior.
Use these triggers in Mapp Engage to enhance in-app messaging campaigns.
Adding Custom Trigger Events in the App
Custom Event Triggers are implemented with Custom Link Action Handling. Developers can embed these links within app code to trigger in-app messages.
Android: Refer to the In-App SDK Integration for Android documentation.
iOS: Refer to the In-App SDK Integration for iOS documentation.
Importing Custom Event Triggers into Mapp Engage
Developers must import custom event triggers into Mapp Engage via an API call to use them in an in-app message.
Prerequisites
An API account for the Mapp Engage system.
API Method
The registerAppEvents method allows developers to create a list of mobile app events.
API Details:
Domain:
mobileVersion: v10+
Purpose: Create custom mobile app events for in-app triggers.
Parameters:
Name | Type | Description |
|---|---|---|
|
| The ID of the app where events will be registered. |
|
| A list of mobile app events to create. |
Exceptions:
Exception | Description |
|---|---|
| The specified app ID could not be found. |
| One or more parameters are invalid. |
| An unexpected backend error occurred. |
Example Code Snippet:
import com.mapp.api.MobileAppEvent;
public class CustomEventTrigger {
public static void main(String[] args) {
Long appId = 12345L; // Replace with your App ID
MobileAppEvent[] events = {
new MobileAppEvent("eventName1", "eventDescription1"),
new MobileAppEvent("eventName2", "eventDescription2")
};
try {
MobileAPI.registerAppEvents(appId, events);
System.out.println("Custom events registered successfully.");
} catch (NoSuchObjectException e) {
System.err.println("App ID not found: " + e.getMessage());
} catch (InvalidParameterException e) {
System.err.println("Invalid parameter: " + e.getMessage());
} catch (UnexpectedErrorException e) {
System.err.println("Unexpected error: " + e.getMessage());
}
}
}For additional information, please refer to our API documentation.