> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flashduty.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Data Collection

> Comprehensive overview of performance metrics, event attributes, and device information automatically collected by Flashduty iOS RUM SDK

<Info>
  iOS RUM SDK automatically generates events with relevant metrics and attributes. Each RUM event includes default attributes (such as `view.url`, `device.type`, `geo.country`) as well as event-specific metrics and attributes (such as `view.time_spent`, `resource.method`).
</Info>

## App Startup Metrics

During app startup, the iOS SDK automatically records app startup time and creates corresponding views.

<Note>
  Startup time measures the time interval from process start to the first `applicationDidBecomeActive` notification.
</Note>

| Attribute             | Type        | Description                                                        |
| --------------------- | ----------- | ------------------------------------------------------------------ |
| `view.is_start_view`  | Boolean     | Identifies if this view is the initial view created at app startup |
| `action.type`         | String      | Type of app startup action, value is `application_start`           |
| `action.loading_time` | Number (ns) | Time required for app startup                                      |

## View Monitoring

In iOS apps, views are automatically created when users visit different screens. Views start recording when users open a screen and stop when the view is no longer visible.

<Tip>
  **View Lifecycle Management:**

  * Views don't end immediately when stopped, but remain in `inactive` state for a period
  * If a new view starts during this period, the previous view will completely end
  * If no new view starts, the previous view will resume to `active` state
</Tip>

<Note>
  **Background Behavior:**

  * When app enters background, SDK retains the last active view and monitors background events
  * Background time is not counted toward the active view's `time_spent` metric
  * If user returns to app immediately, SDK resumes the original `time_spent` measurement
</Note>

## Default Attributes

iOS RUM SDK automatically attaches default attributes to all events, helping you understand user devices, network status, and app context.

<AccordionGroup>
  <Accordion title="Core Attributes">
    | Attribute        | Type    | Description                                                         |
    | ---------------- | ------- | ------------------------------------------------------------------- |
    | `date`           | Integer | Event timestamp (milliseconds)                                      |
    | `type`           | String  | Event type (e.g., `session`, `view`, `resource`, `error`, `action`) |
    | `service`        | String  | Service name that generated this event                              |
    | `application.id` | String  | Application unique identifier                                       |
  </Accordion>

  <Accordion title="Device Attributes">
    The following device-related attributes are automatically attached to all events:

    | Attribute      | Type   | Description                                                      |
    | -------------- | ------ | ---------------------------------------------------------------- |
    | `device.type`  | String | Device type (e.g., `Mobile`, `Tablet`, `TV`, `Desktop`, `Other`) |
    | `device.brand` | String | Device brand, `Apple` for iOS devices                            |
    | `device.model` | String | Device model (e.g., `iPhone`, `iPad`, `iPod Touch`, `Apple TV`)  |
    | `device.name`  | String | Device name                                                      |
  </Accordion>

  <Accordion title="Operating System Attributes">
    The following OS-related attributes are automatically attached to all events:

    | Attribute          | Type   | Description                                           |
    | ------------------ | ------ | ----------------------------------------------------- |
    | `os.name`          | String | Operating system name (e.g., `iOS`, `iPadOS`, `tvOS`) |
    | `os.version`       | String | Operating system version (e.g., `15.4.1`, `16.0`)     |
    | `os.version_major` | String | Operating system major version (e.g., `15`, `16`)     |
  </Accordion>

  <Accordion title="Network Connectivity Attributes">
    The following network-related attributes are automatically attached to resource and error events:

    | Attribute                            | Type         | Description                                                              |
    | ------------------------------------ | ------------ | ------------------------------------------------------------------------ |
    | `connectivity.status`                | String       | Device network connection status (e.g., `connected`, `not_connected`)    |
    | `connectivity.interfaces`            | String Array | Available network interface types (e.g., `wifi`, `cellular`, `ethernet`) |
    | `connectivity.cellular.technology`   | String       | Cellular network technology type (e.g., `3G`, `4G`, `LTE`, `5G`)         |
    | `connectivity.cellular.carrier_name` | String       | Cellular network carrier name                                            |
  </Accordion>

  <Accordion title="Geo-location Attributes">
    The following attributes relate to IP address geo-location:

    | Attribute                 | Type   | Description                                                            |
    | ------------------------- | ------ | ---------------------------------------------------------------------- |
    | `geo.country`             | String | Country name                                                           |
    | `geo.country_iso_code`    | String | Country ISO code (e.g., `US`, `CN`)                                    |
    | `geo.country_subdivision` | String | First-level administrative division (e.g., US states, China provinces) |
    | `geo.continent_code`      | String | Continent ISO code (e.g., `EU`, `AS`)                                  |
    | `geo.continent`           | String | Continent name                                                         |
    | `geo.city`                | String | City name                                                              |

    <Note>
      Geo-location information is inferred by Flashcat backend based on client IP address. Precise GPS location is not collected on the client.
    </Note>
  </Accordion>

  <Accordion title="Global User Attributes">
    You can enable user tracking on all RUM events to correlate user sessions and simplify troubleshooting.

    | Attribute          | Type   | Description                                        |
    | ------------------ | ------ | -------------------------------------------------- |
    | `usr.id`           | String | User unique identifier                             |
    | `usr.name`         | String | User-friendly name, displayed by default in RUM UI |
    | `usr.email`        | String | User email address, displayed if no username       |
    | `usr.anonymous_id` | String | Anonymous user identifier                          |

    <Tip>
      User attributes are optional but we recommend providing at least one. See [Track User Information](/en/rum/sdk/ios/sdk-integration#track-user-information).
    </Tip>

    <Note>
      Only the standard user fields above are supported. Other user attributes are not supported. If needed, configure them under `context`.
    </Note>
  </Accordion>
</AccordionGroup>

## Event-Specific Attributes

Different event types have specific attributes and metrics.

<AccordionGroup>
  <Accordion title="Session Attributes">
    | Attribute                   | Type    | Description                              |
    | --------------------------- | ------- | ---------------------------------------- |
    | `session.id`                | String  | Session unique identifier                |
    | `session.type`              | String  | Session type (e.g., `user`, `synthetic`) |
    | `session.is_active`         | Boolean | Whether session is active                |
    | `session.initial_view.id`   | String  | Initial view ID in session               |
    | `session.initial_view.url`  | String  | Initial view URL in session              |
    | `session.initial_view.name` | String  | Initial view name in session             |
    | `session.last_view.id`      | String  | Last view ID in session                  |
    | `session.last_view.url`     | String  | Last view URL in session                 |
    | `session.last_view.name`    | String  | Last view name in session                |
    | `session.has_crash`         | Boolean | Whether session contains crash events    |
    | `session.has_replay`        | Boolean | Whether session has replay enabled       |
  </Accordion>

  <Accordion title="View Attributes">
    | Attribute                   | Type        | Description                                          |
    | --------------------------- | ----------- | ---------------------------------------------------- |
    | `view.id`                   | String      | View unique identifier                               |
    | `view.url`                  | String      | View URL, corresponds to UIViewController class name |
    | `view.name`                 | String      | Customizable view name                               |
    | `view.referrer`             | String      | Previous view URL                                    |
    | `view.action.count`         | Number      | Number of user actions collected in this view        |
    | `view.error.count`          | Number      | Number of errors collected in this view              |
    | `view.resource.count`       | Number      | Number of resources collected in this view           |
    | `view.time_spent`           | Number (ns) | Time user spent on this view                         |
    | `view.network_settled_time` | Number (ns) | Time for view to fully initialize at startup         |
    | `view.is_active`            | Boolean     | Whether view is active                               |
    | `view.is_slow_rendered`     | Boolean     | Whether view rendering is slow                       |
    | `view.crash.count`          | Number      | Number of crashes in this view                       |
    | `view.frozen_frame.count`   | Number      | Number of frozen frames in this view                 |
    | `view.refresh_rate_average` | Number      | View average refresh rate                            |
    | `view.refresh_rate_min`     | Number      | View minimum refresh rate                            |
    | `view.memory_average`       | Number      | View average memory usage                            |
    | `view.memory_max`           | Number      | View maximum memory usage                            |
    | `view.cpu_ticks_count`      | Number      | View CPU tick count                                  |
    | `view.cpu_ticks_per_second` | Number      | View CPU ticks per second                            |
  </Accordion>

  <Accordion title="Resource Attributes">
    | Attribute                      | Type           | Description                                                         |
    | ------------------------------ | -------------- | ------------------------------------------------------------------- |
    | `resource.id`                  | String         | Resource unique identifier                                          |
    | `resource.url`                 | String         | Resource URL                                                        |
    | `resource.method`              | String         | HTTP method (e.g., `GET`, `POST`, `PATCH`, `DELETE`)                |
    | `resource.type`                | String         | Resource type (e.g., `xhr`, `image`, `font`, `css`, `js`)           |
    | `resource.status_code`         | Number         | HTTP response status code                                           |
    | `resource.size`                | Number (bytes) | Resource size                                                       |
    | `resource.duration`            | Number (ns)    | Total time to load resource                                         |
    | `resource.connect.duration`    | Number (ns)    | Time to establish server connection (connectEnd - connectStart)     |
    | `resource.ssl.duration`        | Number (ns)    | Time for TLS handshake                                              |
    | `resource.dns.duration`        | Number (ns)    | Time for DNS resolution (domainLookupEnd - domainLookupStart)       |
    | `resource.first_byte.duration` | Number (ns)    | Time waiting for first byte response (responseStart - requestStart) |
    | `resource.download.duration`   | Number (ns)    | Time to download response (responseEnd - responseStart)             |
    | `resource.redirect.duration`   | Number (ns)    | Time for subsequent HTTP requests (redirectEnd - redirectStart)     |
  </Accordion>

  <Accordion title="Error Attributes">
    | Attribute        | Type    | Description                                                    |
    | ---------------- | ------- | -------------------------------------------------------------- |
    | `error.id`       | String  | Error unique identifier                                        |
    | `error.message`  | String  | Concise, human-readable one-line error message                 |
    | `error.source`   | String  | Error source (e.g., `network`, `source`, `console`, `webview`) |
    | `error.stack`    | String  | Error stack trace or supplementary information                 |
    | `error.type`     | String  | Error type or error code                                       |
    | `error.is_crash` | Boolean | Whether this error caused app crash                            |
  </Accordion>

  <Accordion title="Action Attributes">
    | Attribute               | Type        | Description                                                            |
    | ----------------------- | ----------- | ---------------------------------------------------------------------- |
    | `action.id`             | String      | User action UUID                                                       |
    | `action.type`           | String      | User action type (e.g., `tap`, `scroll`, `swipe`, `application_start`) |
    | `action.name`           | String      | User action name                                                       |
    | `action.target.name`    | String      | Element user interacted with                                           |
    | `action.loading_time`   | Number (ns) | Action loading time                                                    |
    | `action.resource.count` | Number      | Number of resources triggered by this action                           |
    | `action.error.count`    | Number      | Number of errors triggered by this action                              |
  </Accordion>
</AccordionGroup>

## Data Storage

Before data is uploaded to Flashcat, it is stored in plaintext in the app's cache directory.

<Check>
  **Security Protection:**

  * Cache folder is protected by iOS app sandbox
  * Other apps cannot read this data
</Check>

<Warning>
  **Security Notes:**

  * If device is jailbroken, stored data may become readable
  * Sensitive data should not be included in RUM events, or should be obfuscated or filtered via Event Mapper before sending
</Warning>

## Related Documentation

<CardGroup cols={3}>
  <Card title="SDK Integration" icon="rocket" href="/en/rum/sdk/ios/sdk-integration">
    Learn how to integrate the iOS SDK
  </Card>

  <Card title="Advanced Configuration" icon="sliders" href="/en/rum/sdk/ios/advanced-config">
    Configure custom attributes, sampling, and event filtering
  </Card>

  <Card title="Insights" icon="chart-line" href="/en/rum/analytics/native">
    View and analyze collected RUM data
  </Card>
</CardGroup>
