Skip to content

React Native Application Integration


Collect metrics data from React Native applications and visualize application performance for analysis.

Reading Path

Prerequisites

Note

If the RUM Headless service is enabled, the prerequisites are automatically configured and you can directly integrate the application.

Application Integration

Note

The current React Native version only supports Android and iOS platforms.

  1. Navigate to RUM > Create Application > React Native;
  2. Create two applications, one for React Native Android and one for React Native iOS, to receive RUM data from Android and iOS platforms respectively;
  3. Enter the corresponding application name and application ID for each platform;
  4. Select the application integration method:

    • Public DataWay: directly receive RUM data without installing the DataKit collector.
    • Local environment deployment: receive RUM data after meeting the prerequisites.

Installation

Source Code: https://github.com/GuanceCloud/datakit-react-native

Demo: https://github.com/GuanceCloud/datakit-react-native/example

In the project root, run the following command in the terminal:

npm install @cloudcare/react-native-mobile

This will add the following dependency to the package.json file:

"dependencies": {
"@cloudcare/react-native-mobile": "[latest_version]",
"..."
}

Additional Android Integration Configuration:

  • 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 Guance Android Maven repository URL in Gradle, required for both Plugin and AAR. For details, refer to build.gradle in the example.

Initialization Notes

For a minimal initialization example, see Quick Start.

For the complete FTMobileConfig parameter description, see SDK Initialization.

Detailed Configuration Entry

Advanced Scenarios

FAQ

Feedback

Is this page helpful?