> For the complete documentation index, see [llms.txt](https://docs.groundcover.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.groundcover.com/getting-started/installation-and-updating/connect-rum/mobile.md). Agents can also search and read this documentation through its [MCP server](https://docs.groundcover.com/~gitbook/mcp).

# Mobile

Send real user monitoring data from your iOS and Android apps to groundcover.

groundcover mobile RUM captures how real users experience your iOS and Android apps: sessions, screen views, taps and gestures, network requests, logs, errors, crashes, app hangs, app start time, and frame rendering. Mobile data appears in the same RUM pages as your web data, and network requests link to your backend traces.

## Supported platforms

| Platform                 | Package                       | Install from          | Source code                                                                                                   | Guide                                                                                                                     |
| ------------------------ | ----------------------------- | --------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| React Native             | `@groundcover/react-native`   | npm                   | [`packages/react-native`](https://github.com/groundcover-com/groundcover-rum/tree/main/packages/react-native) | [React Native](https://docs.groundcover.com/getting-started/installation-and-updating/connect-rum/mobile/react-native.md) |
| Flutter                  | `groundcover_rum`             | pub.dev               | [`packages/flutter`](https://github.com/groundcover-com/groundcover-rum/tree/main/packages/flutter)           | [Flutter](https://docs.groundcover.com/getting-started/installation-and-updating/connect-rum/mobile/flutter.md)           |
| iOS (Swift, Objective-C) | `GroundcoverRum`              | Swift Package Manager | [`packages/ios`](https://github.com/groundcover-com/groundcover-rum/tree/main/packages/ios)                   | [iOS](https://docs.groundcover.com/getting-started/installation-and-updating/connect-rum/mobile/ios.md)                   |
| Android (Kotlin, Java)   | `com.groundcover:rum-android` | Maven Central         | [`packages/android`](https://github.com/groundcover-com/groundcover-rum/tree/main/packages/android)           | [Android](https://docs.groundcover.com/getting-started/installation-and-updating/connect-rum/mobile/android.md)           |

The SDKs are open source, in the [`groundcover-rum`](https://github.com/groundcover-com/groundcover-rum) repository. Each SDK's README there is its full reference: every option, default and hook.

{% hint style="warning" %}
Use one groundcover SDK per app. The React Native and Flutter SDKs include their own native crash and performance capture, so don't add the native iOS or Android SDK to the same app.
{% endhint %}

To compare what each SDK collects, see [What each platform collects](https://docs.groundcover.com/getting-started/installation-and-updating/connect-rum.md#what-each-platform-collects).

## Before you start

Every mobile SDK takes the same values when it starts:

| Value         | Required | What it is                                                                                                                                                                                                                                                                                                                    |
| ------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `apiKey`      | Yes      | A dedicated [ingestion key](https://docs.groundcover.com/collect-data/ingestion-keys.md) of type `RUM`. Create one under **Settings → Access → Ingestion Keys**. The same key type works for web and mobile.                                                                                                                  |
| `dsn`         | Yes      | Your public groundcover endpoint, in the format `https://example.platform.grcv.io`, where `example.platform.grcv.io` is your `ingress.site` installation value. Use the origin only: no path and no trailing slash.                                                                                                           |
| `cluster`     | Yes      | The cluster name you filter RUM data by. While it's empty, events are held in memory and not sent.                                                                                                                                                                                                                            |
| `environment` | Yes      | The deployment environment, such as `production` or `staging`. Reported as `env`.                                                                                                                                                                                                                                             |
| `appId`       | Yes      | An identifier for your app. Reported as `service.name` and `app.id`. It can't be blank.                                                                                                                                                                                                                                       |
| `releaseId`   | No       | The release of your app, such as `1.4.0` or a commit hash. React Native [source maps](https://docs.groundcover.com/getting-started/installation-and-updating/connect-rum/source-maps.md) are matched by `appId` and the release. When `releaseId` isn't set, groundcover uses the app version (`app.version`) as the release. |

The SDKs also report your app's version and build number as `app.version` and `app.build`. The native and Flutter SDKs read them from the app bundle. React Native reads them through `expo-constants` when it's installed. Otherwise, set `appVersion` and `appBuild` in the options.

## How mobile sessions work

* **Sending starts with the user.** The SDK sends nothing until the user touches the app or brings it to the foreground. Until then it holds up to 500 events, so background launches such as push notifications don't create empty sessions.
* **Sessions end after inactivity or a maximum duration.** A session rotates after 30 minutes without activity, or once it passes its maximum duration. The maximum is 4 hours by default and can be set from 1 minute to 8 hours. Both checks run on the next event, so an idle session can stay open past the limit.
* **Sampling is decided at launch.** `sessionSampleRate` (0 to 1) is decided when the SDK starts. A sampled-out launch sends nothing, and sessions that start later while the app runs keep the launch's decision. The next launch decides again.
* **Events are sent in batches.** The SDK sends a batch every 10 seconds, sooner once 10 events other than taps, screen changes, and performance events are queued, and when the app moves to the background. Failed batches aren't retried, and events still in memory when the app is killed are lost.
* **Crashes are sent on the next launch.** Crash reports are written to disk and sent when the app starts again, under the session they happened in. Up to 10 reports are kept until they're delivered.

## Privacy

Every mobile SDK masks sensitive data by default and follows the same model:

| Level                    | What it does                                                                                                             |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------ |
| Mask sensitive (default) | Redacts the values of sensitive keys in network request and response bodies, query parameters, logs, and error messages. |
| Mask all                 | Everything above, plus masks the labels of tapped elements and text fields.                                              |
| Allow                    | Turns masking off. Credential headers are still redacted.                                                                |

The level is named `mask-sensitive` in React Native, `PrivacyLevel.maskSensitive` in Flutter, `.maskSensitive` in Swift, and `PrivacyLevel.MASK_SENSITIVE` in Kotlin. Each SDK page shows how to set it.

At every level:

* **Credential headers are redacted:** the header is kept, and its value becomes `[REDACTED]`. This applies to `authorization`, `cookie`, `set-cookie`, and any header whose name contains `key`, `token`, `secret`, `passwd`, `password`, `auth`, `bearer`, or `credential`.
* **Typed text is never captured.** Text input is recorded as an event, without its value.
* **Elements you mark as private** have their labels masked. Each SDK page shows how.

The built-in sensitive keys are `token`, `secret`, `passwd`, `password`, `api_key`, `access_key`, `write_key`, `auth`, `bearer`, `credential`, `cvv`, `ssn`, `credit_card`, and `card_number`, matched case-insensitively anywhere in a key. In query strings and form bodies, `code`, `state`, `session_state`, `id_token`, `access_token`, and `refresh_token` also count. Add your own with the `sensitiveKeys` privacy option.

{% hint style="info" %}
Custom event attributes and the user identity you set aren't masked. Scrub sensitive values before you send them, or in the `enrichEvent` hook.
{% endhint %}

## Find your data

In groundcover, open [RUM](https://app.groundcover.com/rum/summary) and switch the header from **Web** to **Mobile**. [Sessions](https://docs.groundcover.com/investigate/real-user-monitoring-rum/sessions.md), [Exceptions](https://docs.groundcover.com/investigate/real-user-monitoring-rum/exceptions.md), and [Vitals](https://docs.groundcover.com/investigate/real-user-monitoring-rum/vitals.md#mobile-vitals) then show your mobile apps. To query the data, filter by `category:mobile-rum`. See [Querying RUM data](https://docs.groundcover.com/investigate/real-user-monitoring-rum/querying.md).

## Troubleshooting

Turn on the SDK's `debug` option and touch the app once. Within about 10 seconds, the SDK logs `[groundcover] Sending batch:`. If it doesn't, check these first:

| Symptom                                                  | Likely cause                                                                                                   |
| -------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| Nothing is logged after you touch the app                | The SDK didn't start. Check that the init call runs at app launch and that `appId` isn't blank.                |
| Batches fail with `401`, or are sent but no data appears | The key is missing, wrong, or revoked. Some SDKs don't log a rejected key, so check it with the request below. |
| Batches fail with `404`                                  | `dsn` includes a path such as `/json/rum`. Use the origin only.                                                |
| Nothing is sent, and no error                            | `cluster` is empty, so events are held in memory.                                                              |
| Connection errors                                        | The device can't reach the `dsn` host.                                                                         |

To check a key and endpoint before you build, send an empty batch:

```bash
curl -s -w '\n%{http_code}\n' -X POST "https://example.platform.grcv.io/json/rum" \
  -H "apikey: ${RUM_INGESTION_KEY}" \
  -H "Content-Type: application/json" \
  -d '{"sessionAttributes":{},"events":[]}'
```

| Response | Meaning                                                                       |
| -------- | ----------------------------------------------------------------------------- |
| `200`    | The key and endpoint work.                                                    |
| `404`    | Nothing serves `/json/rum` on that host. Check the endpoint.                  |
| `401`    | The key is missing, wrong, or revoked. Check the `apikey` header and the key. |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.groundcover.com/getting-started/installation-and-updating/connect-rum/mobile.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
