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 automatically configured, 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 Android and iOS platforms respectively.
- Enter the corresponding application name and application ID for each platform's application.
-
Choose the application integration method:
- Public DataWay: Directly receives RUM data without installing the DataKit collector.
- Local environment deployment: Receives RUM data after meeting the prerequisites.
Installation¶
Source Code Address: https://github.com/TrueWatchTech/datakit-react-native
Demo Address: https://github.com/TrueWatchTech/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 launch events, network request data, and Android Native-related events (page navigation, click events, Native network requests, WebView data).
-
Also 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 complete FTMobileConfig parameter explanations, 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