MoEngage is a mobile marketing automation company. This capacitor SDK helps you track events, trigger smart notifications.
npm install capacitor-moengage-coreMoEngage is a mobile marketing automation company. This capacitor SDK helps you track events, trigger smart notifications.
``bash`
npm install capacitor-moengage-core
npx cap sync
* initialize(...)
* trackEvent(...)
* setUniqueId(...)
* setAlias(...)
* setUserName(...)
* setFirstName(...)
* setLastName(...)
* setEmailId(...)
* setMobileNumber(...)
* setBirthDate(...)
* setGender(...)
* setUserLocation(...)
* setUserAttribute(...)
* setUserAttributeDate(...)
* setUserAttributeLocation(...)
* setAppStatus(...)
* logoutUser(...)
* enableSdk(...)
* disableSdk(...)
* showInApp(...)
* getSelfHandledInApp(...)
* selfHandledShown(...)
* selfHandledClicked(...)
* selfHandledDismissed(...)
* setInAppContext(...)
* resetInAppContext(...)
* enableDataTracking(...)
* disableDataTracking(...)
* passFcmPushToken(...)
* passFcmPushPayload(...)
* registerForPush()
* onOrientationChanged()
* addListener('pushTokenGenerated', ...)
* addListener('pushClicked', ...)
* addListener('inAppCampaignShown', ...)
* addListener('inAppCampaignClicked', ...)
* addListener('inAppCampaignDismissed', ...)
* addListener('inAppCampaignCustomAction', ...)
* addListener('inAppCampaignSelfHandled', ...)
* enableAdIdTracking(...)
* disableAdIdTracking(...)
* enableAndroidIdTracking(...)
* disableAndroidIdTracking(...)
* setupNotificationChannelsAndroid()
* pushPermissionResponseAndroid(...)
* navigateToSettingsAndroid()
* requestPushPermissionAndroid()
* addListener('onPermissionResult', ...)
* enableDeviceIdTracking(...)
* disableDeviceIdTracking(...)
* updatePushPermissionRequestCountAndroid(...)
* deleteUser(...)
* showNudge(...)
* Interfaces
* Type Aliases
* Enums
`typescript`
initialize(options: { appId: string; initConfig: MoEInitConfig; }) => Promise
Initialise MoEngage Capacitor Plugin
| Param | Type |
| ------------- | --------------------------------------------------------------------------------------- |
| options | { appId: string; initConfig: MoEInitConfig; } |
Since: 2.0.0
--------------------
`typescript`
trackEvent(options: { eventName: string; eventAttributes?: MoEProperties; appId: string; }) => Promise
Track user behaviour as events with properties
| Param | Type |
| ------------- | ---------------------------------------------------------------------------------------------------------------- |
| options | { eventName: string; eventAttributes?: MoEProperties; appId: string; } |
Since: 2.0.0
--------------------
`typescript`
setUniqueId(options: { uniqueId: string; appId: string; }) => Promise
Set a Unique Identifier for the user.
| Param | Type |
| ------------- | ------------------------------------------------- |
| options | { uniqueId: string; appId: string; } |
Since: 2.0.0
--------------------
`typescript`
setAlias(options: { alias: string; appId: string; }) => Promise
Set an Alias to update the existing Unique Id
| Param | Type |
| ------------- | ---------------------------------------------- |
| options | { alias: string; appId: string; } |
Since: 2.0.0
--------------------
`typescript`
setUserName(options: { userName: string; appId: string; }) => Promise
Set user's full name
| Param | Type |
| ------------- | ------------------------------------------------- |
| options | { userName: string; appId: string; } |
Since: 2.0.0
--------------------
`typescript`
setFirstName(options: { firstName: string; appId: string; }) => Promise
Set user's first name
| Param | Type |
| ------------- | -------------------------------------------------- |
| options | { firstName: string; appId: string; } |
Since: 2.0.0
--------------------
`typescript`
setLastName(options: { lastName: string; appId: string; }) => Promise
Set user's last name
| Param | Type |
| ------------- | ------------------------------------------------- |
| options | { lastName: string; appId: string; } |
--------------------
`typescript`
setEmailId(options: { emailId: string; appId: string; }) => Promise
Set user's email id
| Param | Type |
| ------------- | ------------------------------------------------ |
| options | { emailId: string; appId: string; } |
Since: 2.0.0
--------------------
`typescript`
setMobileNumber(options: { mobileNumber: string; appId: string; }) => Promise
Set user's mobile number
| Param | Type |
| ------------- | ----------------------------------------------------- |
| options | { mobileNumber: string; appId: string; } |
--------------------
`typescript`
setBirthDate(options: { birthdate: string; appId: string; }) => Promise
Set user's birthdate.
| Param | Type |
| ------------- | -------------------------------------------------- |
| options | { birthdate: string; appId: string; } |
Since: 1.0.0
--------------------
`typescript`
setGender(options: { gender: MoEUserGender; appId: string; }) => Promise
Set user's gender.
| Param | Type |
| ------------- | ----------------------------------------------------------------------------------- |
| options | { gender: MoEUserGender; appId: string; } |
Since: 2.0.0
--------------------
`typescript`
setUserLocation(options: { location: MoEGeoLocation; appId: string; }) => Promise
Set user's location
| Param | Type |
| ------------- | --------------------------------------------------------------------------------------- |
| options | { location: MoEGeoLocation; appId: string; } |
Since: 2.0.0
--------------------
`typescript`
setUserAttribute(options: { name: string; value: string | number | boolean | Array
Set the user defined attribute with value.
| Param | Type |
| ------------- | --------------------------------------------------------------------------------------------------------- |
| options | { name: string; value: string \| number \| boolean \| string[] \| number[]; appId: string; } |
Since: 2.0.0
--------------------
`typescript`
setUserAttributeDate(options: { name: string; value: string; appId: string; }) => Promise
Set a user attribute timestamp for the current user
| Param | Type |
| ------------- | ------------------------------------------------------------ |
| options | { name: string; value: string; appId: string; } |
Since: 2.0.0
--------------------
`typescript`
setUserAttributeLocation(options: { name: string; location: MoEGeoLocation; appId: string; }) => Promise
Set the user attribute location
| Param | Type |
| ------------- | ----------------------------------------------------------------------------------------------------- |
| options | { name: string; location: MoEGeoLocation; appId: string; } |
Since: 2.0.0
--------------------
`typescript`
setAppStatus(options: { appStatus: MoEAppStatus; appId: string; }) => Promise
This API tells the SDK whether it is a fresh install or an existing application was updated.
| Param | Type |
| ------------- | ------------------------------------------------------------------------------------ |
| options | { appStatus: MoEAppStatus; appId: string; } |
Since: 2.0.0
--------------------
`typescript`
logoutUser(options: { appId: string; }) => Promise
Notify the SDK that the user has logged out of the application
| Param | Type |
| ------------- | ------------------------------- |
| options | { appId: string; } |
Since: 2.0.0
--------------------
`typescript`
enableSdk(options: { appId: string; }) => Promise
API to enable SDK usage.
| Param | Type |
| ------------- | ------------------------------- |
| options | { appId: string; } |
Since: 2.0.0
--------------------
`typescript`
disableSdk(options: { appId: string; }) => Promise
API to disable all features of the SDK.
| Param | Type |
| ------------- | ------------------------------- |
| options | { appId: string; } |
Since: 2.0.0
--------------------
`typescript`
showInApp(options: { appId: string; }) => Promise
Call this method wherever InApp message has to be shown, if available.
| Param | Type |
| ------------- | ------------------------------- |
| options | { appId: string; } |
Since: 2.0.0
--------------------
`typescript`
getSelfHandledInApp(options: { appId: string; }) => Promise
Triggers fetching self handled in-app, the result is returned in the inAppCampaignSelfHandled listener
| Param | Type |
| ------------- | ------------------------------- |
| options | { appId: string; } |
Since: 2.0.0
--------------------
`typescript`
selfHandledShown(campaignData: MoEInAppSelfHandledCampaignData) => Promise
API to track self handled in-app shown event.
| Param | Type | Description |
| ------------------ | ------------------------------------------------------------------------------------------- | --------------- |
| campaignData | MoEInAppSelfHandledCampaignData | in-app campaign |
Since: 2.0.0
--------------------
`typescript`
selfHandledClicked(campaignData: MoEInAppSelfHandledCampaignData) => Promise
API to track click event of any other widget apart from primary widget in the self handled in-app.
| Param | Type | Description |
| ------------------ | ------------------------------------------------------------------------------------------- | --------------- |
| campaignData | MoEInAppSelfHandledCampaignData | in-app campaign |
Since: 2.0.0
--------------------
`typescript`
selfHandledDismissed(campaignData: MoEInAppSelfHandledCampaignData) => Promise
API to track self handled in-app's dismiss event.
| Param | Type | Description |
| ------------------ | ------------------------------------------------------------------------------------------- | --------------- |
| campaignData | MoEInAppSelfHandledCampaignData | in-app campaign |
Since: 2.0.0
--------------------
`typescript`
setInAppContext(options: { contexts: Array
Set current context for in-app module.
| Param | Type |
| ------------- | --------------------------------------------------- |
| options | { contexts: string[]; appId: string; } |
Since: 2.0.0
--------------------
`typescript`
resetInAppContext(options: { appId: string; }) => Promise
Resets/Clears the previously set context for in-app module.
| Param | Type |
| ------------- | ------------------------------- |
| options | { appId: string; } |
Since: 2.0.0
--------------------
`typescript`
enableDataTracking(options: { appId: string; }) => Promise
Optionally opt-in data tracking.
| Param | Type |
| ------------- | ------------------------------- |
| options | { appId: string; } |
Since: 2.0.0
--------------------
`typescript`
disableDataTracking(options: { appId: string; }) => Promise
Optionally opt-out of data tracking. When data tracking is opted no event or user
attribute is tracked on MoEngage Platform.
| Param | Type |
| ------------- | ------------------------------- |
| options | { appId: string; } |
Since: 2.0.0
--------------------
`typescript`
passFcmPushToken(options: { token: string; appId: string; }) => Promise
Pass FCM Push Token to the MoEngage SDK
| Param | Type |
| ------------- | ---------------------------------------------- |
| options | { token: string; appId: string; } |
Since: 2.0.0
--------------------
`typescript`
passFcmPushPayload(options: { payload: object; appId: string; }) => Promise
Pass FCM payload to MoEngage SDK
| Param | Type |
| ------------- | ------------------------------------------------ |
| options | { payload: object; appId: string; } |
Since: 2.0.0
--------------------
`typescript`
registerForPush() => Promise
Register For Push Notification for iOS
Since: 2.0.0
--------------------
`typescript`
onOrientationChanged() => Promise
Notifies MoEngage SDK of device orientation change
Since: 2.0.0
--------------------
`typescript`
addListener(eventName: 'pushTokenGenerated', listenerFunc: MoEPushTokenListener) => Promise
Listen for push token generated event
| Param | Type |
| ------------------ | --------------------------------------------------------------------- |
| eventName | 'pushTokenGenerated' |
| listenerFunc | MoEPushTokenListener |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
Since: 2.0.0
--------------------
`typescript`
addListener(eventName: 'pushClicked', listenerFunc: MoEPushClickListener) => Promise
Listen for push clicked event
| Param | Type |
| ------------------ | --------------------------------------------------------------------- |
| eventName | 'pushClicked' |
| listenerFunc | MoEPushClickListener |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
Since: 1.0.0
--------------------
`typescript`
addListener(eventName: 'inAppCampaignShown', listenerFunc: MoEInAppShownListener) => Promise
Listen for in-app campaign shown event
| Param | Type |
| ------------------ | ----------------------------------------------------------------------- |
| eventName | 'inAppCampaignShown' |
| listenerFunc | MoEInAppShownListener |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
Since: 1.0.0
--------------------
`typescript`
addListener(eventName: 'inAppCampaignClicked', listenerFunc: MoEInAppClickedListener) => Promise
Listen for in-app campaign clicked event
| Param | Type |
| ------------------ | --------------------------------------------------------------------------- |
| eventName | 'inAppCampaignClicked' |
| listenerFunc | MoEInAppClickedListener |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
Since: 1.0.0
--------------------
`typescript`
addListener(eventName: 'inAppCampaignDismissed', listenerFunc: MoEInAppDismissedListener) => Promise
| Param | Type |
| ------------------ | ------------------------------------------------------------------------------- |
| eventName | 'inAppCampaignDismissed' |
| listenerFunc | MoEInAppDismissedListener |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
--------------------
`typescript`
addListener(eventName: 'inAppCampaignCustomAction', listenerFunc: MoEInAppCustomActionListener) => Promise
Listen for in-app campaign custom action event
| Param | Type |
| ------------------ | ------------------------------------------------------------------------------------- |
| eventName | 'inAppCampaignCustomAction' |
| listenerFunc | MoEInAppCustomActionListener |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
Since: 1.0.0
--------------------
`typescript`
addListener(eventName: 'inAppCampaignSelfHandled', listenerFunc: MoEInAppSelfHandledListener) => Promise
Listen for in-app campaign self handled available event
getSelfHandledInApp() api call returns the available self handled in-app via this listener.
| Param | Type |
| ------------------ | ----------------------------------------------------------------------------------- |
| eventName | 'inAppCampaignSelfHandled' |
| listenerFunc | MoEInAppSelfHandledListener |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
Since: 1.0.0
--------------------
`typescript`
enableAdIdTracking(options: { appId: string; }) => Promise
Enables GAID tracking, by default GAID tracking is disabled.
| Param | Type |
| ------------- | ------------------------------- |
| options | { appId: string; } |
Since: 2.0.0
--------------------
`typescript`
disableAdIdTracking(options: { appId: string; }) => Promise
Disables GAID tracking.
| Param | Type |
| ------------- | ------------------------------- |
| options | { appId: string; } |
Since: 2.0.0
--------------------
`typescript`
enableAndroidIdTracking(options: { appId: string; }) => Promise
Enables Android ID tracking, by default ANdroid ID tracking is disabled.
| Param | Type |
| ------------- | ------------------------------- |
| options | { appId: string; } |
Since: 2.0.0
--------------------
`typescript`
disableAndroidIdTracking(options: { appId: string; }) => Promise
Disables Android ID tracking.
| Param | Type |
| ------------- | ------------------------------- |
| options | { appId: string; } |
Since: 2.0.0
--------------------
`typescript`
setupNotificationChannelsAndroid() => Promise
API to create notification channels on Android.
Since: 2.0.0
--------------------
`typescript`
pushPermissionResponseAndroid(options: { isGranted: boolean; }) => Promise
Notify the SDK on notification permission granted to the application.
| Param | Type |
| ------------- | ------------------------------------ |
| options | { isGranted: boolean; } |
Since: 2.0.0
--------------------
`typescript`
navigateToSettingsAndroid() => Promise
Navigates the user to the Notification settings on Android 8 or above,
on older versions the user is navigated the application settings or
application info screen.
--------------------
`typescript`
requestPushPermissionAndroid() => Promise
Requests the push permission on Android 13 and above.
--------------------
`typescript`
addListener(eventName: 'onPermissionResult', listenerFunc: MoEPermissionListener) => Promise
Listen for permission response
| Param | Type |
| ------------------ | ----------------------------------------------------------------------- |
| eventName | 'onPermissionResult' |
| listenerFunc | MoEPermissionListener |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
Since: 2.0.0
--------------------
`typescript`
enableDeviceIdTracking(options: { appId: string; }) => Promise
Enable Device-id tracking. It is enabled by default and should be called only if tracking is disabled at some point.
| Param | Type |
| ------------- | ------------------------------- |
| options | { appId: string; } |
--------------------
`typescript`
disableDeviceIdTracking(options: { appId: string; }) => Promise
Disables Device-id tracking.
| Param | Type |
| ------------- | ------------------------------- |
| options | { appId: string; } |
--------------------
`typescript`
updatePushPermissionRequestCountAndroid(options: { appId: string; count: number; }) => Promise
Updates the Notification request attempt count, the request attempt count will be
incremented by the passed fresh count.
NOTE: Call this API only when the Application is handling the Notification request
permission.
| Param | Type |
| ------------- | ---------------------------------------------- |
| options | { appId: string; count: number; } |
--------------------
`typescript`
deleteUser(options: { appId: string; }, callback: MoEUserDeleteCallback) => Promise
Delete Current User Data From MoEngage Server
| Param | Type | Description |
| -------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
| options | { appId: string; } | |
| callback | MoEUserDeleteCallback | instance of {@link MoEUserDeleteCallback} to get the API response |
--------------------
`typescript`
showNudge(options: { position: MoENudgePosition; appId: string; }) => Promise
Show Nudge
| Param | Type |
| ------------- | ------------------------------------------------------------------------------------------- |
| options | { position: MoENudgePosition; appId: string; } |
--------------------
#### MoEInitConfig
| Prop | Type | Description |
| --------------------- | ----------------------------------------------------------------- | --------------------- |
| analyticsConfig | MoEAnalyticsConfig | Analytics Config data |
#### MoEAnalyticsConfig
| Prop | Type | Description |
| --------------------------------------------- | -------------------- | ---------------------------------------------------------------------------- |
| shouldTrackUserAttributeBooleanAsNumber | boolean | Status of whether boolean user attribute should be tracked as number or not. |
#### MoEProperties
User attributes object
| Prop | Type | Description |
| ------------------------ | --------------------------------------------------------------------------------------------------------- | ---------------------------- |
| generalAttributes | Array<MoEGeneralAttributes> | General Attributes |
| dateTimeAttributes | Array<MoEDateTimeAttributes> | Location Attributes |
| locationAttributes | Array<MoELocationAttributes> | Date time Attributes |
| isNonInteractive | boolean | Is the event non-interactive |
#### Array
| Prop | Type | Description |
| ------------ | ------------------- | ------------------------------------------------------------------------------------------------------ |
| length | number | Gets or sets the length of the array. This is a number one higher than the highest index in the array. |
| Method | Signature | Description |
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| toString | () => string | Returns a string representation of an array. |
| toLocaleString | () => string | Returns a string representation of an array. The elements are converted to string using their toLocalString methods. |
| pop | () => T \| undefined | Removes the last element from an array and returns it. If the array is empty, undefined is returned and the array is not modified. |
| push | (...items: T[]) => number | Appends new elements to the end of an array, and returns the new length of the array. |
| concat | (...items: ConcatArray<T>[]) => T[] | Combines two or more arrays. This method returns a new array without modifying any existing arrays. |
| concat | (...items: (T \| ConcatArray<T>)[]) => T[] | Combines two or more arrays. This method returns a new array without modifying any existing arrays. |
| join | (separator?: string \| undefined) => string | Adds all the elements of an array into a string, separated by the specified separator string. |
| reverse | () => T[] | Reverses the elements in an array in place. This method mutates the array and returns a reference to the same array. |
| shift | () => T \| undefined | Removes the first element from an array and returns it. If the array is empty, undefined is returned and the array is not modified. |
| slice | (start?: number \| undefined, end?: number \| undefined) => T[] | Returns a copy of a section of an array. For both start and end, a negative index can be used to indicate an offset from the end of the array. For example, -2 refers to the second to last element of the array. |
| sort | (compareFn?: ((a: T, b: T) => number) \| undefined) => this | Sorts an array in place. This method mutates the array and returns a reference to the same array. |
| splice | (start: number, deleteCount?: number \| undefined) => T[] | Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. |
| splice | (start: number, deleteCount: number, ...items: T[]) => T[] | Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. |
| unshift | (...items: T[]) => number | Inserts new elements at the start of an array, and returns the new length of the array. |
| indexOf | (searchElement: T, fromIndex?: number \| undefined) => number | Returns the index of the first occurrence of a value in an array, or -1 if it is not present. |
| lastIndexOf | (searchElement: T, fromIndex?: number \| undefined) => number | Returns the index of the last occurrence of a specified value in an array, or -1 if it is not present. |
| every | <S extends T>(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any) => this is S[] | Determines whether all the members of an array satisfy the specified test. |
| every | (predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any) => boolean | Determines whether all the members of an array satisfy the specified test. |
| some | (predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any) => boolean | Determines whether the specified callback function returns true for any element of an array. |
| forEach | (callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any) => void | Performs the specified action for each element in an array. |
| map | <U>(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any) => U[] | Calls a defined callback function on each element of an array, and returns an array that contains the results. |
| filter | <S extends T>(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any) => S[] | Returns the elements of an array that meet the condition specified in a callback function. |
| filter | (predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any) => T[] | Returns the elements of an array that meet the condition specified in a callback function. |
| reduce | (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T) => T | Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. |
| reduce | (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T) => T | |
| reduce | <U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U) => U | Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. |
| reduceRight | (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T) => T | Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. |
| reduceRight | (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T) => T | |
| reduceRight | <U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U) => U | Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. |
#### ConcatArray
| Prop | Type |
| ------------ | ------------------- |
| length | number |
| Method | Signature |
| --------- | ------------------------------------------------------------------ |
| join | (separator?: string \| undefined) => string |
| slice | (start?: number \| undefined, end?: number \| undefined) => T[] |
#### MoEGeneralAttributes
General Attributes for tracking events
| Prop | Type |
| ----------- | ---------------------------------------------------------------- |
| name | string |
| value | string \| number \| boolean \| string[] \| number[] |
#### MoEDateTimeAttributes
Date and time attribute object
| Prop | Type | Description |
| ----------- | ------------------- | ------------------------------------------------------------- |
| name | string | Date and time attribute name |
| value | string | Attribute value in ISO8601 format [yyyy-MM-dd'T'HH:mm:ss'Z']. |
#### MoELocationAttributes
Location attribute object
| Prop | Type | Description |
| ----------- | --------------------------------------------------------- | ------------------------- |
| name | string | Location Attribute name |
| value | MoEGeoLocation | Location attribute value. |
#### MoEGeoLocation
Location object
| Prop | Type |
| --------------- | ------------------- |
| latitude | number |
| longitude | number |
#### MoEInAppSelfHandledCampaignData
Data for self handled campaign.
| Prop | Type | Description |
| ------------------ | ----------------------------------------------------------------------------------- | -------------------- |
| accountMeta | MoEAccountMeta | Account information |
| campaignData | MoEInAppCampaignData | In-App Campaign data |
| selfHandled | MoEInAppSelfHandledCampaign | SelfHandled data |
#### MoEAccountMeta
Account Object
| Prop | Type | Description |
| ----------- | ------------------- | ------------------ |
| appId | string | Account identifier |
#### MoEInAppCampaignData
Campaign data.
| Prop | Type | Description |
| --------------------- | --------------------------------------------------------------------------- | -------------------------------------------------------------------- |
| campaignId | string | Unique Identifier for the campaign |
| campaignName | string | Name given to the campaign while creation on the MoEngage Dashboard. |
| campaignContext | MoEInAppCampaignContext | Additional Meta data related to the campaign. |
#### MoEInAppCampaignContext
Additional Meta data related to the campaign.
| Prop | Type | Description |
| ------------------------- | --------------------------------------------------------- | --------------------------------------------- |
| formattedCampaignId | string | Formatted Campaign Id |
| attributes | Map<string, object> | Additional Meta data related to the campaign. |
#### Map
| Prop | Type |
| ---------- | ------------------- |
| size | number |
| Method | Signature |
| ----------- | -------------------------------------------------------------------------------------------------------------- |
| clear | () => void |
| delete | (key: K) => boolean |
| forEach | (callbackfn: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any) => void |
| get | (key: K) => V \| undefined |
| has | (key: K) => boolean |
| set | (key: K, value: V) => this |
#### MoEInAppSelfHandledCampaign
Self Handled campaign object
| Prop | Type | Description |
| --------------------- | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| payload | string | Self handled campaign payload. |
| dismissInterval | number | Interval after which in-app should be dismissed, unit - Seconds |
| isCancellable | boolean | Should the campaign be dismissed by pressing the back button or using the back gesture. if the value is true campaign should be dismissed on back press. |
#### PluginListenerHandle
| Prop | Type |
| ------------ | ----------------------------------------- |
| remove | () => Promise<void> |
#### MoEPushTokenData
Push token object
| Prop | Type | Description |
| ----------------- | --------------------------------------------------------- | -------------------- |
| platform | MoEPlatform | Platform type |
| pushService | MoEPushService | Type of push service |
| token | String | Push Token |
#### String
Allows manipulation and formatting of text strings and determination and location of substrings within strings.
| Prop | Type | Description |
| ------------ | ------------------- | ------------------------------------------------------------ |
| length | number | Returns the length of a String object. |
| Method | Signature | Description |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- |
| toString | () => string | Returns a string representation of a string. |
| charAt | (pos: number) => string | Returns the character at the specified index. |
| charCodeAt | (index: number) => number | Returns the Unicode value of the character at the specified location. |
| concat | (...strings: string[]) => string | Returns a string that contains the concatenation of two or more strings. |
| indexOf | (searchString: string, position?: number \| undefined) => number | Returns the position of the first occurrence of a substring. |
| lastIndexOf | (searchString: string, position?: number \| undefined) => number | Returns the last occurrence of a substring in the string. |
| localeCompare | (that: string) => number | Determines whether two strings are equivalent in the current locale. |
| match | (regexp: string \| RegExp) => RegExpMatchArray \| null | Matches a string with a regular expression, and returns an array containing the results of that search. |
| replace | (searchValue: string \| RegExp, replaceValue: string) => string | Replaces text in a string, using a regular expression or search string. |
| replace | (searchValue: string \| RegExp, replacer: (substring: string, ...args: any[]) => string) => string | Replaces text in a string, using a regular expression or search string. |
| search | (regexp: string \| RegExp) => number | Finds the first substring match in a regular expression search. |
| slice | (start?: number \| undefined, end?: number \| undefined) => string | Returns a section of a string. |
| split | (separator: string \| RegExp, limit?: number \| undefined) => string[] | Split a string into substrings using the specified separator and return them as an array. |
| substring | (start: number, end?: number \| undefined) => string | Returns the substring at the specified location within a String object. |
| toLowerCase | () => string | Converts all the alphabetic characters in a string to lowercase. |
| toLocaleLowerCase | (locales?: string \| string[] \| undefined) => string | Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. |
| toUpperCase | () => string | Converts all the alphabetic characters in a string to uppercase. |
| toLocaleUpperCase | (locales?: string \| string[] \| undefined) => string | Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. |
| trim | () => string | Removes the leading and trailing white space and line terminator characters from a string. |
| substr | (from: number, length?: number \| undefined) => string | Gets a substring beginning at the specified location and having the specified length. |
| valueOf | () => string | Returns the primitive value of the specified object. |
#### RegExpMatchArray
| Prop | Type |
| ----------- | ------------------- |
| index | number |
| input | string |
#### RegExp
| Prop | Type | Description |
| ---------------- | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| source | string | Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal. |
| global | boolean | Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. |
| ignoreCase | boolean | Returns a Boolean value indicating the state of the ignoreCase flag (i) used with a regular expression. Default is false. Read-only. |
| multiline | boolean | Returns a Boolean value indicating the state of the multiline flag (m) used with a regular expression. Default is false. Read-only. |
| lastIndex | number | |
| Method | Signature | Description |
| ----------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| exec | (string: string) => RegExpExecArray \| null | Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search. |
| test | (string: string) => boolean | Returns a Boolean value that indicates whether or not a pattern exists in a searched string. |
| compile | () => this | |
#### RegExpExecArray
| Prop | Type |
| ----------- | ------------------- |
| index | number |
| input | string |
#### MoEPushCampaignData
Push event data
| Prop | Type | Description |
| ------------------ | ----------------------------------------------------------- | -------------------- |
| accountMeta | MoEAccountMeta | Account information |
| pushCampaign | MoEPushCampaign | Push campaign object |
| platform | MoEPlatform | Platform data |
#### MoEPushCampaign
Push campaign object
| Prop | Type | Description |
| --------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| isDefaultAction | boolean | Is the click action a defualt action |
| clickedAction | Map<String, object> | Clicked Action data |
| payload | Map<String, object> | Key-Value Pair entered on the MoEngage Platform during campaign creation. |
#### MoEInAppLifecycleData
In-App lifecycle event camapaign data
| Prop | Type | Description |
| ------------------ | --------------------------------------------------------------------- | -------------------- |
| accountMeta | MoEAccountMeta | Account information |
| campaignData | MoEInAppCampaignData | In-App Campaign data |
| platform | MoEPlatform | Platform information |
#### MoEInAppNavigationData
In-App navigation event campaign data
| Prop | Type | Description |
| ------------------ | --------------------------------------------------------------------- | ---------------------- |
| accountMeta | MoEAccountMeta | Account information |
| campaignData | MoEInAppCampaignData | In-App Campaign data |
| navigation | MoEInAppNavigation | Navigation action data |
| platform | MoEPlatform | Platform Data |
#### MoEInAppNavigation
In-App navigation action data
| Prop | Type | Description |
| -------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| actionType` | MoEInAppActionType | InApp Action type |
| *