React Native Application Integration¶
Collect metrics data from React Native applications to analyze application performance visually.
Reading Path¶
- First-time integration: Start with Quick Start
- Complete integration: Continue reading this article
- Parameter details: Refer to SDK Initialization, RUM Configuration, Log Configuration, Trace Configuration
- Customization capabilities: Refer to Custom Tag Usage, Data Collection Custom Rules, Data Collection Masking
- Advanced scenarios: Refer to specialized pages under the "Advanced Scenarios" group
- Troubleshooting: Refer to Troubleshooting
Prerequisites¶
Note
If the RUM Headless service has been activated, the prerequisites are already configured automatically, and you can proceed directly with application integration.
- Install DataKit.
- Configure the RUM Collector.
- Configure DataKit to be accessible via the public network and install the IP Geolocation Database.
Application Integration¶
Note
The current React Native version only supports Android and iOS platforms.
- Navigate to RUM > Create > React Native.
- Create two separate applications for React Native Android and React Native iOS to receive RUM data from the Android and iOS platforms respectively.
- Enter the corresponding application name and application ID for each platform's application.
-
Choose the application integration method:
- Public Network DataWay: Receives RUM data directly without installing the DataKit collector.
- Local Environment Deployment: Receives RUM data after meeting the prerequisites.
Installation¶
Source Code Repository: https://github.com/GuanceCloud/datakit-react-native
Demo Repository: https://github.com/GuanceCloud/datakit-react-native/example
In your project directory, run the following command in the terminal:
This will add the following dependency to your package.json:
Additional Configuration for Android Integration:
- Configure the Gradle Plugin ft-plugin to collect App startup events, network request data, and Android Native-related events (page navigation, click events, Native network requests, WebView data).
- You also need to configure the TrueWatch Android Maven repository address in Gradle. Both the Plugin and AAR require this. For configuration details, refer to the build.gradle in the example.
Initialization Instructions¶
For a minimal initialization example, please read Quick Start.
For a complete explanation of FTMobileConfig parameters, please read SDK Initialization.
Detailed Configuration Entries¶
Advanced Scenarios¶
- Custom Tag Usage
- Data Collection Custom Rules
- Data Collection Masking
- Dynamic Configuration
- Source Map Upload
- WebView Data Monitoring
- Native and React Native Hybrid Development
- Android Resource Manual Configuration