Installation
Install MoEngage’s Inbox Plugin to your application, using the npm package manager. And then link your native dependencies.react-native-moengage plugin. Make sure you have installed the react-native-moengage plugin as well. Refer to the link for the same.
Android Installation
Configuration Required For Older React Version (Optional)
This step is required only if react-native auto-linking is not working.
getPackages()
Path - android/app/src/main/java/package-name/MainApplication.java
Note: Your Application class name might vary, go to your application class.
iOS Installation
To run the application in the new react architecture, follow these steps:- Navigate to the iOS folder.
- Run the command RCT_NEW_ARCH_ENABLED=1 bundle exec pod install to install the necessary dependencies.
- Navigate to the iOS folder.
- Run the command pod install to install the necessary dependencies.
Inbox Initialization
To initialise Inbox, pass Workspace ID as parameter toinitialize(Workspace ID) method of MoEReactInbox as shown below
Fetch Messages
To fetch all the inbox messages usefetchAllMessages() method as shown below, where you would get an instance of MoEInboxData
InboxData Payload
MoEInboxData will be received in the below format:Get Unclicked Message Count
To obtain the unclicked messages count from the Inbox usegetUnClickedCount() method as shown below:
Track Message Clicks
To track clicks on the messages inside your Inbox usetrackMessageClicked() method as shown below:
Delete Message
To delete a particular message from the list of messages usedeleteMessage() method as shown below: