Initialize React-Native Component
Initialize the MoEngage Plugin in the App.js of your application by calling the ReactMoE.initilize(YOUR_APP_ID) in the render() or componentDidMount()
import ReactMoE from 'react-native-moengage'
ReactMoE.initialize(YOUR APP ID);
Initialize with Configuration (optional)
import ReactMoE from 'react-native-moengage';
import { MoEInitConfig, MoEPushConfig, MoEngageLogConfig, MoEngageLogLevel } from "react-native-moengage";
const moEInitConfig = new MoEInitConfig(
MoEPushConfig.defaultConfig(),
new MoEngageLogConfig(MoEngageLogLevel.DEBUG, isEnabledForReleaseBuild)
);
ReactMoE.initialize(YOUR APP ID, moEInitConfig);
warning |
Note Make sure you are setting the Push/InApp callback listeners before calling the initialize(). |
Refer to the following for platform-specific initialization:
For more information about samples, refer to React-Native Sample App