Skip to content

React Native Application Access


Collect metrics from React Native applications to analyze application performance visually.

Reading Path

Prerequisites

Note

If the RUM Headless service is enabled, the prerequisites have been configured automatically and you can access the application directly.

When deploying in a local environment, complete the following data receiver configuration; when using the public DataWay, you do not need to deploy DataKit yourself.

Application Access

Note

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

  1. Go to RUM > Create Application > React Native;
  2. Create two applications, one for React Native Android and one for React Native iOS, so that RUM data from the Android and iOS platforms can be received separately;
  3. Enter the corresponding application name and application ID for each platform's application;
  4. In "Select an Access Method", choose Agent Automatic Access or Manual Access, then complete "Access Configuration".

Select an Access Method

On the application configuration page, select "Agent Automatic Access" or "Manual Access", then complete "Access Configuration". For existing applications, you can go directly to the configuration page to continue the access.

Access Method Use Cases Entry Point
Agent Automatic Access Want a coding assistant to analyze the project and complete the SDK integration Copy the prompt generated in the console and hand it to the coding assistant in the application code repository
Manual Access Want to install the SDK and configure parameters yourself Confirm the data reporting method, then follow this document and Quick Start to complete the configuration

Agent Automatic Access

  1. On the current application's configuration page, select "Agent Automatic Access".
  2. Copy the complete prompt from "Access Configuration", ensuring it uses the current application's access information.
  3. Open the coding assistant in the application code repository, paste the prompt, and let the Agent analyze the project and complete the SDK configuration according to the access guide.
  4. Build and run the application, trigger operations such as page views, and confirm in the current application's Explorer that data is received.

When using a cross-platform framework, tell the Agent the framework and target platforms, and provide the application information for each platform separately.

If the page indicates that your personal API Key or temporary authorization code is not ready, complete it as prompted, then copy the prompt again.

Manual Access

On the application configuration page, select "Manual Access" and confirm the data reporting method:

  • Public DataWay: receives RUM data directly; no need to install the DataKit Collector.
  • Local environment deployment: receives RUM data after the prerequisites are met.

Follow Installation and Quick Start below to complete SDK installation, initialization, and verification. If an SDK configuration already exists, review and reuse it first to avoid duplicate initialization.

Installation

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

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

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

npm install @truewatchtech/react-native-mobile

This adds the following dependency to the package's package.json:

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

Additional Android Integration Configuration:

  • Configure the Gradle Plugin ft-plugin to collect app launch events and network request data, as well as Android Native events (page navigation, click events, Native network requests, and WebView data).

  • You also need to configure the TrueWatch Android Maven repository address in Gradle for both the Plugin and the AAR. For configuration details, see build.gradle in the example.

Initialization Notes

For a minimal initialization example, see Quick Start.

For complete FTMobileConfig parameter descriptions, see SDK Initialization.

Detailed Configuration Entry Points

Advanced Scenarios

FAQ