Installation
You need to install the@userpilot/segment-react-native and the @userpilot/react-native dependency.
Userpilot segment react native latest version
Check Userpilot ReactNative SDK for more details.
pod install after the installation to autolink the Userpilot SDK.
Initialization
In your code where you initialize the analytics client call the.add(plugin) method with an UserpilotPlugin instance:
Configurations (Optional)
Your events will now begin to flow to Userpilot in device mode.
Userpilot SDK callbacks
To gain full control and utilize the full capabilities of the Userpilot SDK in a React Native environment, you can start listening to Userpilot events using thestartListeningToUserpilotEvents function from @userpilot/segment-react-native.
For example, to handle deep links and other SDK-triggered events, you can implement the appropriate event callbacks like this: