Introduction
Complete list of all public methods in the Mapp Engage React Native Plugin, grouped by function. Platform availability: Both = iOS and Android, iOS = iOS only, Android = Android only. An asterisk (*) indicates the method exists on both platforms but is a no-op on the indicated platform in the current SDK version.
Initialization & Status
| Method | Returns | Platform | Description |
|---|
engage(sdkKey, googleProjectId, server, appID, tenantID) | void | Both | Initializes the SDK. On iOS, only server is used. |
engageTestServer(cepUrl, sdkKey, googleProjectId, server, appID, tenantID) | void | Android | Initializes against a custom CEP test endpoint. |
isReady() | Promise<boolean> | Both | Returns true when the SDK is initialized. |
onInitCompletedListener() | Promise<void> | Android | Resolves when initialization completes. |
addInitListener(listener) | EmitterSubscription | iOS | Fires when iOS SDK initialization completes. |
Device & Registration
| Method | Returns | Platform | Description |
|---|
isDeviceRegistered() | Promise<boolean> | Both | Returns true when the device is registered with Mapp. |
getDeviceInfo() | Promise<Object> | Both | Returns general device information. |
getDeviceDmcInfo() | Promise<any> | Android | Returns device DMC configuration from the Mapp backend. Returns null on iOS. |
Push Notifications
| Method | Returns | Platform | Description |
|---|
isPushEnabled() | Promise<boolean> | Both | Returns true when push notifications are enabled. |
setPushEnabled(optIn) | void | Both | Enables or disables push notifications. |
requestPostNotificationPermission() | Promise<boolean> | Both | Requests POST_NOTIFICATIONS permission on Android 13+. Returns true on iOS without prompting. |
setPostponeNotificationRequest(postpone) | void | iOS | Delays the system notification permission prompt. Call before engage(). |
showNotificationAlertView() | void | iOS | Triggers the iOS notification permission dialog. |
setShowNotificationsAtForeground(value) | void | iOS | Controls notification display when the app is in the foreground. |
setToken(token) | Promise<boolean> | Both | Sets the FCM registration token manually. |
getToken() | Promise<string> | Both | Returns the current FCM registration token. |
setRemoteMessage(remoteMessage) | void | Both | Forwards a Firebase remote message to the Mapp SDK for processing. |
isPushFromMapp(remoteMessage) | Promise<boolean> | Both | Returns true if the remote message originates from Mapp. |
clearNotifications() | void | Both | Clears all app notifications from the notification tray. |
clearNotification(identifier) | void | Both | Clears a specific notification by identifier. |
removeBadgeNumber() | void | Both* | Removes the app badge number. No-op on Android SDK v7. |
addPushListener(listener) | EmitterSubscription | Both | Subscribes to push notification events. |
removePushListener(listener) | void | Both | Removes a push notification listener. |
addDeepLinkingListener(listener) | EmitterSubscription | Both | Subscribes to deep link events from push notifications. |
removeDeepLinkingListener(listener) | void | Both | Removes a deep link listener. |
GeoFencing
| Method | Returns | Platform | Description |
|---|
requestGeofenceLocationPermission() | Promise<boolean> | Both | Requests location permission required for geofencing. |
startGeoFencing() | Promise<string> | Both | Starts geofence region monitoring. |
stopGeoFencing() | Promise<string> | Both | Stops geofence region monitoring. |
startGeofencing() | Promise<string> | Both | Alternative spelling of startGeoFencing(). Calls a separate native method — use startGeoFencing() unless your native setup specifically exports startGeofencing. |
stopGeofencing() | Promise<string> | Both | Alternative spelling of stopGeoFencing(). See note on startGeofencing(). |
In-App Messaging
| Method | Returns | Platform | Description |
|---|
triggerInApp(value) | void | Both | Triggers an in-app message by event name. |
fetchInboxMessage() | Promise<any> | iOS | Fetches inbox messages. Results delivered via addInboxMessagesListener. |
fetchLatestInboxMessage() | Promise<any> | Both | Fetches the latest inbox message. |
addInboxMessagesListener(listener) | EmitterSubscription | iOS | Receives the full inbox message list after fetchInboxMessage(). |
addInboxMessageListener(listener) | EmitterSubscription | iOS | Receives individual inbox message events. |
addRichMessagesListener(listener) | EmitterSubscription | iOS | Receives rich push message content. |
inAppMarkAsRead(templateId, eventId) | void | iOS* | Marks an inbox message as read. No-op on Android SDK v7. |
inAppMarkAsUnRead(templateId, eventId) | void | iOS* | Marks an inbox message as unread. No-op on Android SDK v7. |
inAppMarkAsDeleted(templateId, eventId) | void | iOS* | Marks an inbox message as deleted. No-op on Android SDK v7. |
triggerStatistic(templateId, originalEventId, trackingKey, displayMillis, reason, link) | string | Android* | Tracks an in-app message statistic. No-op in Android SDK v7. |
User Data
| Method | Returns | Platform | Description |
|---|
setAlias(alias, resendAttributes?) | Promise<boolean> | Both | Sets the device alias. Pass true as second argument to resend stored custom attributes to the backend. |
getAlias() | Promise<string> | Both | Returns the current device alias. |
setAttributes(attributes) | void | Both | Sets multiple custom attributes from an object. |
getAttributes(keys) | Promise<Object> | Both | Returns values for the specified attribute keys. |
setAttributeString(key, value) | void | Both | Sets a single string custom attribute. |
setAttributeInt(key, value) | void | Both | Sets a single integer custom attribute. |
getAttributeStringValue(key) | Promise<string> | Both | Returns the string value of a custom attribute. |
removeAttribute(key) | void | Android | Removes a custom attribute by key. |
incrementNumericKey(key, value) | void | iOS | Increments a numeric custom attribute by the given value. |
addTag(tag) | void | Both | Adds a tag to the device. |
removeTag(tag) | void | Both | Removes a tag from the device. |
getTags() | Promise<string[]> | Both | Returns all tags set on the device. |
addCustomEvent(event) | Promise<void> | Both | Sends a CustomEvent object to the Mapp backend. |
runAction(name, value?) | Promise<any> | Android | Executes a named SDK action. Used internally by addCustomEvent(). |
logOut(pushEnabled) | void | Both | Clears the user identity. Pass true to keep push active after logout. |
Screen Orientation
| Method | Returns | Platform | Description |
|---|
lockScreenOrientation(value) | void | Android* | Locks or unlocks screen orientation. No-op in Android SDK v7. |