---
title: Configure mobile monitoring settings
source: https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/configure-settings
---

## Android

Use the methods below to change default mobile monitoring settings. All settings, including the call to invoke the agent, are called in the `onCreate` method of the `MainActivity` class.

To change settings, you have two options (if the setting supports it):

-   Change the setting on its own line for each specific condition. For example:

```java
NewRelic.disableFeature(FeatureFlag.DefaultInteractions);
NewRelic.enableFeature(FeatureFlag.CrashReporting);
NewRelic.withApplicationToken(NEW_RELIC_TOKEN).start(this.getApplication());
```

OR

-   Change the setting as part of the agent start call using the `.with` method. For example:

```java
NewRelic.withApplicationToken(NEW_RELIC_TOKEN)
        .withDefaultInteractions(false)
        .withCrashReportingEnabled(true)
        .start(this.getApplication());
```

### Data endpoint settings [#android-data-endpoint-settings]

| Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | Example                                                                                                                                                                         |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Enable or disable crash reporting, which appears on the [**Crash analysis** page](https://docs.newrelic.com/docs/mobile-monitoring/mobile-monitoring-ui/crashes/crash-analysis-group-filter-your-crashes). Specifies the URI authority component of the harvest data upload endpoint. This endpoint is also used for handled exception uploads. To replace data endpoint the agent will use when reporting data harvests, add `andCollectorAddress:` to your `NewRelic.withApplicationToken(“<TOKEN>”)` method call. Default value is `mobile-collector.newrelic.com`. | ```java NewRelic.withApplicationToken(“<TOKEN>”)         .usingCollectorAddress("harvest-upload.domain.com")         .usingCrashCollectorAddress("crash-upload.domain.com") ``` |
| Specifies the authority component of the crash data upload URI. To replace data endpoint the agent will use when reporting crashes, add `andCrashCollectorAddress:` to your `NewRelic.withApplicationToken(“<TOKEN>”)` method call. Default value is `mobile-crash.newrelic.com`.                                                                                                                                                                                                                                                                                      | ```java NewRelic.withApplicationToken(“<TOKEN>”)         .usingCollectorAddress("harvest-upload.domain.com")         .usingCrashCollectorAddress("crash-upload.domain.com") ``` |

### Analytics settings [#android-analytics-settings]

| Description                                                                                                                                                                                                                                                                                                                                                                         | Example                                                                                                              |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| Enable or disable collection of event data. These events [can be queried with NRQL](https://docs.newrelic.com/docs/insights/explore-data/attributes/mobile-default-attributes-insights) and used in the [**Crash analysis** page](https://docs.newrelic.com/docs/mobile-monitoring/mobile-monitoring-ui/crashes/crash-analysis-group-filter-your-crashes). Default value is `true`. | ```java withAnalyticsEvents(false) ```                                                                               |
| Enable or disable the reporting of event data. Event **collection** will still occur, but the events will not be sent to our collector. You might decide to use this instead of `withAnalyticsEvents` if you wanted to disable collection but still be able to see what the agent was collecting. Default value is `true`.                                                          | ```java NewRelic.enableFeature(FeatureFlag.AnalyticsEvents) NewRelic.disableFeature(FeatureFlag.AnalyticsEvents) ``` |

### App launch time settings [#android-applaunchtime]

| Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Example                                                                                                              |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| Enable or disable reporting app launch time (cold and hot time) to the [metrics](https://docs.newrelic.com/docs/data-apis/understand-data/new-relic-data-types/#metrics): - Cold start time refers to an app’s starting from scratch. This means that the app’s process has not been created by the system until then. - Hot start time refers to when your app’s process is already running in the background. Default value is `true`. | ```java NewRelic.enableFeature(FeatureFlag.AppStartMetrics) NewRelic.disableFeature(FeatureFlag.AppStartMetrics) ``` |

### Application settings [#android-application-settings]

| Description                                                                                         | Example                                                     |
| --------------------------------------------------------------------------------------------------- | ----------------------------------------------------------- |
| Set the application's version as a string. Defaults to version number set in `AndroidManifest.xml`. | ```java withApplicationVersion("MY APP VERSION") ```        |
| Set the build's version as a string. Defaults to build ID set in `AndroidManifest.xml`.             | ````java withApplicationBuild("MY BUILD VERSION") ```  ```` |

### Background reporting [#android-background-reporting]

| Description                                                                                                                                                                                                                                                                                               | Example                                                                                                                                                                                                                 |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Enable or disable background reporting when application goes to the background state. When enabled, the agent reports data captured while the app is in the background, and the [`background` attribute](/attribute-dictionary/?event=MobileSession&attribute=background) is added to session attributes. | Background reporting is disabled by default. To enable it, add the following feature flag: ```java NewRelic.enableFeature(FeatureFlag.BackgroundReporting) NewRelic.disableFeature(FeatureFlag.BackgroundReporting) ``` |

### Crash and error reporting settings [#crash-error-reporting-settings]

| Description                                                                                                                                                                                                                                                           | Example                                                                                                                  |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| Enables or disables [deferred crash reporting](https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile-android/install-configure/android-agent-crash-reporting/#deferred-crash-reporting). Default value is `false`.                                        | ```java withCrashReportingEnabled(true) ```                                                                              |
| Enable or disable recording handled exceptions events, which appear on the [Handled exception page](https://docs.newrelic.com/docs/mobile-monitoring/mobile-monitoring-ui/crashes/handled-exceptions-analyze-trends-prevent-crashes). Default value is `true`.        | ```java NewRelic.enableFeature(FeatureFlag.HandledExceptions) NewRelic.disableFeature(FeatureFlag.HandledExceptions) ``` |
| Enable or disable recording of native runtime crashes, exceptions and Application Not Responding (ANR) conditions, which appear on the [Crash Analysis page](https://docs.newrelic.com/docs/mobile-monitoring/mobile-monitoring-ui/crashes). Default value is `true`. | ```java NewRelic.enableFeature(FeatureFlag.NativeReporting) NewRelic.disableFeature(FeatureFlag.NativeReporting) ```     |

### Distributed tracing [#dt]

| Description                                                                                                                                                                                                                                                                                                                                 | Example                                                                                                                    |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| Enable or disable the adding of distributed tracing headers to network requests. Default value is `true`. Refer to [How New Relic distributed tracing works](https://docs.newrelic.com/docs/distributed-tracing/concepts/how-new-relic-distributed-tracing-works#browser-spans) for more information on distributed tracing in mobile apps. | ```java NewRelic.enableFeature(FeatureFlag.DistributedTracing) NewRelic.disableFeature(FeatureFlag.DistributedTracing) ``` |

### Event persistence [#android-event-persistence]

| Description                                                                                                             | Example                                                                                                                                                                                                        |
| ----------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Enable or disable event persistence, which lets the agent capture events during force-close and process-exit scenarios. | Event persistence is enabled by default. To disable it, add the following feature flag: ```java NewRelic.disableFeature(FeatureFlag.EventPersistence) NewRelic.enableFeature(FeatureFlag.EventPersistence) ``` |

### FedRamp settings [#fedrampenabled]

| Description                                                                                                                                 | Example                                                                                                            |
| ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| Enable or disable reporting data using different endpoints for US government clients. Default value is `true` (as of agent version 6.11.0). | ```java NewRelic.enableFeature(FeatureFlag.FedRampEnabled) NewRelic.disableFeature(FeatureFlag.FedRampEnabled) ``` |

### Interaction settings [#interaction-settings]

| Description                                                                                                                                                                                                                       | Example                                                                                                                      |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| Enable or disable interaction tracing. Trace instrumentation still occurs, but no traces are harvested. This will disable default and custom interactions. Default value is `true`.                                               | ```java NewRelic.enableFeature(FeatureFlag.InteractionTracing) NewRelic.disableFeature(FeatureFlag.InteractionTracing) ```   |
| Enable or disable default interactions. Trace instrumentation still occurs, but no traces are harvested. This will enable or disable default interactions only while custom interactions remain enabled. Default value is `true`. | ```java NewRelic.enableFeature(FeatureFlag.DefaultInteractions) NewRelic.disableFeature(FeatureFlag.DefaultInteractions) ``` |

### Logging settings [#logging]

| Description                                                                                                                                                   | Example                                  |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------- |
| Enable or disable agent logging. Default value is `true`.                                                                                                     | ```java withLoggingEnabled(false) ```    |
| Specifies the log level. Options include: - `ERROR` (least verbose) - `WARN` - `INFO` - `VERBOSE` - `DEBUG` - `AUDIT` (most verbose) Default value is `INFO`. | ```java withLogLevel(AgentLog.ERROR) ``` |

### Networking settings [#networking]

| Description                                                                                                                                                                                                                                                                                                                                        | Example                                                                                                                                            |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| Enable or disable reporting successful HTTP requests to the [MobileRequest](https://docs.newrelic.com/docs/insights/nrql-new-relic-query-language/nrql-query-examples/insights-query-examples-new-relic-mobile#mobilerequest-examples) event type. Default value is `true` (as of agent version 5.15.2).                                           | ```java NewRelic.enableFeature(FeatureFlag.NetworkRequests) NewRelic.disableFeature(FeatureFlag.NetworkRequests) ```                               |
| Enable or disable reporting network and HTTP request errors to the [MobileRequestError](https://docs.newrelic.com/docs/insights/nrql-new-relic-query-language/nrql-query-examples/insights-query-examples-new-relic-mobile#mobilerequesterror-examples) event type. Available for Android agent version 5.11.0 or higher. Default value is `true`. | ```java NewRelic.enableFeature(FeatureFlag.NetworkErrorRequests) NewRelic.disableFeature(FeatureFlag.NetworkErrorRequests) ```                     |
| Enable or disable capture of HTTP response bodies for HTTP error traces, and [MobileRequestError](https://docs.newrelic.com/docs/insights/nrql-new-relic-query-language/nrql-query-examples/insights-query-examples-new-relic-mobile#mobilerequesterror-examples) events. Default value is `true`.                                                 | ```java NewRelic.enableFeature(FeatureFlag.HttpResponseBodyCaptureEnabled) NewRelic.disableFeature(FeatureFlag.HttpResponseBodyCaptureEnabled) ``` |

### Offline storage [#android-offline-storage]

| Description                                                                                                                                                                                                                                                            | Example                                                                                                                                                                                                  |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Enable or disable offline data storage when no internet connection is available. To configure the amount of offline storage, see [Set max offline storage size](https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/set-max-offline-storage). | Offline storage is disabled by default. To enable it, add the following feature flag: ```java NewRelic.enableFeature(FeatureFlag.OfflineStorage) NewRelic.disableFeature(FeatureFlag.OfflineStorage) ``` |

## iOS

New Relic's iOS agent provides configuration settings to change the default behavior of the agent. If you make any changes to the default settings, make sure to add the feature flags just after calling the app token. For example:

-   Objective-C:

```objectivec
+ [NewRelic startWithApplicationToken:]
```

-   Swift:

```swift
NewRelic.start(withApplicationToken:)
```

### Enable or disable feature flags [#ios-feature-flags]

To configure feature flags, use the following method defined in `NewRelic.h:`

| iOS language | Procedure                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Objective-C  | In Objective-C, these features are bitmasked, so you can use a `|` to enable or disable multiple features at the same time. Enable a feature flag: ```objectivec +[NewRelic enableFeatures:(NRMAFeatureFlags)flags]; ``` Disable a feature flag: ```objectivec +[NewRelic disableFeatures:(NRMAFeatureFlags)flags]; ``` Here is an example where: - Interaction tracing and experimental networking instrumentation are enabled. - `NSURLSession` instrumentation and crash reporting are disabled. ```objectivec [NewRelic enableFeatures:NRFeatureFlag_SwiftInteractionTracing | NRFeatureFlag_FedRampEnabled]; [NewRelic disableFeatures:NRFeatureFlag_NSURLSessionInstrumentation | NRFeatureFlag_CrashReporting]; [NewRelic startWithApplicationToken:...]; ``` |
| Swift        | Enable a feature flag: ```swift NewRelic.enableFeatures(NRMAFeatureFlags.[NRMAFeatureFlag]) ``` Disable a feature flag: ```swift NewRelic.disableFeatures(NRMAFeatureFlags.[NRMAFeatureFlag]) ``` Example to disable default interaction tracing: ```swift NewRelic.disableFeatures(NRMAFeatureFlags.NRFeatureFlag_DefaultInteractions) ```                                                                                                                                                                                                                                                                                                                                                                                                                          |

### Data endpoint settings [#ios-data-endpoint-settings]

| Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | Example                                                                                                                                                                              |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Enable or disable crash reporting, which appears on the [**Crash analysis** page](https://docs.newrelic.com/docs/mobile-monitoring/mobile-monitoring-ui/crashes/crash-analysis-group-filter-your-crashes). Specifies the URI authority component of the harvest data upload endpoint. This endpoint is also used for handled exception uploads. To replace data endpoint the agent will use when reporting data harvests, add `andCollectorAddress:` to your `NewRelic.start(withApplicationToken:)` method call. Default value is `mobile-collector.newrelic.com`. | ```swift NewRelic.start(withApplicationToken:YOUR_APP_TOKEN         andCollectorAddress:"harvest-upload.domain.com"         andCrashCollectorAddress:"crash-upload.domain.com"); ``` |
| Specifies the authority component of the crash data upload URI. To replace data endpoint the agent will use when reporting crashes, add `andCrashCollectorAddress:` to your `NewRelic.start(withApplicationToken:)` method call. Default value is `mobile-crash.newrelic.com`.                                                                                                                                                                                                                                                                                      | ```swift NewRelic.start(withApplicationToken:YOUR_APP_TOKEN       andCollectorAddress:"harvest-upload.domain.com"       andCrashCollectorAddress:"crash-upload.domain.com"); ```     |

### Crash and error reporting feature flag [#ios-crashes]

If you modify any of crash and error reporting settings below, be sure to call the feature flag before the iOS agent start call.

| Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | Example                                                                                      |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| Enable or disable crash reporting, which appears on the [**Crash analysis** page](https://docs.newrelic.com/docs/mobile-monitoring/mobile-monitoring-ui/crashes/crash-analysis-group-filter-your-crashes). Specifies the URI authority component of the harvest data upload endpoint. This endpoint is also used for handled exception uploads. To replace data endpoint the agent will use when reporting data harvests, add `.usingCollectorAddress()` to your `NewRelic.withApplicationToken()` method call. Default value is `true`. | ```swift NewRelic.disableFeatures(NRMAFeatureFlags.NRFeatureFlag_CrashReporting) ```         |
| Globally enable or disable recording handled exceptions events, which appear on the [Handled exception page](https://docs.newrelic.com/docs/mobile-monitoring/mobile-monitoring-ui/crashes/handled-exceptions-analyze-trends-prevent-crashes). Default value is `true`.                                                                                                                                                                                                                                                                  | ```swift NewRelic.disableFeatures(NRMAFeatureFlags.NRFeatureFlag_HandledExceptionEvents) ``` |

### Distributed tracing [#ios-dt]

| Description                                                                                                                                                                                                                                                                                                                                                           | Example                                                                                  |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| Enable or disable the adding of distributed tracing headers to network requests. Refer to [How New Relic distributed tracing works](https://docs.newrelic.com/docs/understand-dependencies/distributed-tracing/get-started/how-new-relic-distributed-tracing-works/#no-sampling) for more information on distributed tracing in mobile apps. Default value is `true`. | ```swift NewRelic.disableFeatures(NRMAFeatureFlags.NRFeatureFlag_DistributedTracing) ``` |

### Interactions feature flags [#ios-interactions]

If you modify any of crash and error reporting settings below, be sure to call the feature flag just before the New Relic iOS agent start call.

| Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | Example                                                                                      |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| Enable or disable interaction tracing only for default instrumented classes and methods. Custom interactions will be reported. The traces will appear on the [**Interactions** page](https://docs.newrelic.com/docs/mobile-monitoring/mobile-monitoring-ui/mobile-app-pages/interactions-page). Default value is `true`.                                                                                                                                                                                                                                                                                                                                   | ```swift NewRelic.disableFeatures(NRMAFeatureFlags.NRFeatureFlag_DefaultInteractions) ```    |
| Globally enable or disable interaction traces, which appear on the [**Interactions** page](https://docs.newrelic.com/docs/mobile-monitoring/mobile-monitoring-ui/mobile-app-pages/interactions-page). Interaction tracing will be disabled after the agent has started. Interactions for any activity or methods executed prior to starting the agent may still appear on the **Interactions** page. Default value is `true`.                                                                                                                                                                                                                              | ```swift NewRelic.disableFeatures(NRMAFeatureFlags.NRFeatureFlag_InteractionTracing) ```     |
| > #### ⚠️ CAUTION > > Before enabling this feature, see [Enable Swift interaction traces](https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile-ios/install-configure/enable-swift-interaction-traces). If proper steps are not taken, enabling this feature may cause instability. Enable or disable interaction tracing for Swift code. The traces appear on the [**Interactions** page](https://docs.newrelic.com/docs/mobile-monitoring/mobile-monitoring-ui/mobile-app-pages/interactions-page). This feature will always be disabled if [`NRFeatureFlag_InteractionTracing`](#interactionTracing) is disabled. Default value is `false`. | ```swift NewRelic.enableFeatures(NRMAFeatureFlags.NRFeatureFlag_SwiftInteractionTracing) ``` |
| Enable or disable automatic WKWebView instrumentation. Default value is `true`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | ```swift NewRelic.disableFeatures(NRMAFeatureFlags.NRFeatureFlag_WebViewInstrumentation) ``` |
| > #### ⚠️ CAUTION > > This feature is deprecated, enabling this feature flag call may decrease the stability of applications. Avoid using unless instructed by New Relic. Enable or disable automatic gesture instrumentation. Default value is `false`.                                                                                                                                                                                                                                                                                                                                                                                                   | ```swift NewRelic.enableFeatures(NRMAFeatureFlags.NRFeatureFlag_GestureInstrumentation) ```  |

### Networking feature flags [#ios-networking]

If you modify any of settings below, be sure to call the feature flag before the New Relic iOS agent start call.

| Description                                                                                                                                                                                                                                                                                                                                                   | Example                                                                                                    |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| > #### ⚠️ CAUTION > > This feature is deprecated, enabling this feature flag call may decrease the stability of applications. Avoid using unless instructed by New Relic. Enable or disable experimental networking instrumentation. This forces all `NSURLConnection` network requests through the `NRMAURProtocol`. Default value is `false`.               | ```swift NewRelic.enableFeatures(NRMAFeatureFlags.NRFeatureFlag_ExperimentalNetworkingInstrumentation) ``` |
| Enable or disable networking instrumentation for `NSURLSession`. These URL traces are sent to the [HTTP Requests](https://docs.newrelic.com/docs/mobile-monitoring/mobile-monitoring-ui/network-pages/http-requests-page) page. Default value is `true`.                                                                                                      | ```swift NewRelic.disableFeatures(NRMAFeatureFlags.NRFeatureFlag_NSURLSessionInstrumentation) ```          |
| Enable or disable networking instrumentation. This sends the HTTP response data as [MobileRequest](https://docs.newrelic.com/docs/insights/insights-data-sources/default-data/mobile-default-event-attributes-insights#mobilerequest-attributes) events. Default value is `true` (as of agent version 6.0.0).                                                 | ```swift NewRelic.disableFeatures(NRMAFeatureFlags.NRFeatureFlag_NetworkRequestEvents) ```                 |
| Enable or disable HTTP request error event generation of instrumented network calls that result in an error or failure. These events are reported as [MobileRequestError](https://docs.newrelic.com/docs/insights/insights-data-sources/default-data/mobile-default-event-attributes-insights#mobilerequesterror-attributes) events. Default value is `true`. | ```swift NewRelic.disableFeatures(NRMAFeatureFlags.NRFeatureFlag_RequestErrorEvents) ```                   |
| Enable or disable capture of HTTP response bodies for HTTP error traces, and `MobileRequestError` events. Default value is `true`.                                                                                                                                                                                                                            | ```swift NewRelic.disableFeatures(NRMAFeatureFlags.NRFeatureFlag_HttpResponseBodyCapture) ```              |
| Enable or disable instrumentation for async await URL sessions. Default value is `false` (as of agent version 7.4.5).                                                                                                                                                                                                                                         | ```swift NewRelic.enableFeatures(NRMAFeatureFlags.NRFeatureFlag_SwiftAsyncURLSessionSupport) ```           |

### App launch time settings [#ios-applaunchtime]

| Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | Example                                                                              |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| Enable or disable reporting app start time (cold and hot time) as a metric: - Cold time refers to time between starting app and the first draw. - Hot time refers to the time it takes for an app to resume from running in the background to the first draw. Default value is `true` (as of agent version 7.4.0). The AppLaunch/Cold metric on iOS is more restrictive than general definitions suggest. It is only reported once after the following specific criteria are met: - After a device reboot: You must reboot the iOS device, then launch the application for the metric to be reported. - After a fresh install: You must perform a fresh installation of the iOS application and then launch it. - One-time reporting: The metric is generally only received once after these specific events occur, rather than every time the app is killed and restarted. | ```swift NewRelic.enableFeatures(NRMAFeatureFlags.NRFeatureFlag_AppStartMetrics) ``` |

### FedRAMP endpoints settings [#ios-fedramp]

| Description                                                                                          | Example                                                                             |
| ---------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| Enable or disable using the FedRAMP endpoints. Default value is `false` (as of agent version 7.4.5). | ```swift NewRelic.enableFeatures(NRMAFeatureFlags.NRFeatureFlag_FedRampEnabled) ``` |

### Offline storage [#ios-offline-storage]

| Description                                                                                                                                                                                                                                                                                                                                                                                                                                                     | Example                                                                                                                                                                   |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Enable or disable offline data storage when no internet connection is available. When an event is added while the internet is not reachable by the app an [`offline` attribute](/attribute-dictionary/?event=MobileSession&attribute=offline) is added to the event. To configure the amount of offline storage, see [Set max offline storage size](https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/set-max-offline-storage/#ios). | Offline storage is disabled by default. To enable it, add the following feature flag: ```swift NewRelic.enableFeatures(NRMAFeatureFlags.NRFeatureFlag_OfflineStorage) ``` |

### Background reporting [#ios-background-reporting]

| Description                                                                                                                                                                                                                                                                                               | Example                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Enable or disable background reporting when application goes to the background state. When enabled, the agent reports data captured while the app is in the background, and the [`background` attribute](/attribute-dictionary/?event=MobileSession&attribute=background) is added to session attributes. | Background reporting is disabled by default. To enable it, add the following feature flag: ```swift NewRelic.enableFeatures([NRMAFeatureFlags.NRFeatureFlag_BackgroundReporting]) ``` Prerequisites in your iOS app project to use background instrumentation: - Add the key `Permitted background task scheduler identifiers` with an array including an item containing your apps bundle Id. - Enable **Background Fetch** and **Background Processing** in the **Background Modes** section of the Xcode project capabilities. Note: iOS only guarantees that iOS will harvest in the background once per twenty-four hour period. |

### Automatic log collection [#ios-log-collection]

| Description                                                                 | Example                                                                                                                                                                                                                                                                                                                             |
| --------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Enable or disable the collection of `stdout` & `stderr` for remote logging. | Log collection is disabled by default. To enable it, add the following feature flag: ```swift NewRelic.disableFeatures([NRMAFeatureFlags.NRFeatureFlag_AutoCollectLogs]) ``` For more information, see [iOS agent logging](https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile-ios/configuration/ios-remote-logging). |

## Capacitor

The Capacitor agent SDK allows you to configure default settings to change the behavior of the agent.

If you make any changes to the default settings, make sure to add the feature flags just after calling `appToken`.

Here's a sample configuration:

```typescript
import { NewRelicCapacitorPlugin, NREnums, AgentConfiguration } from '@newrelic/newrelic-capacitor-plugin';
import { Capacitor } from '@capacitor/core';

var appToken;

if(Capacitor.getPlatform() === 'ios') {
  appToken = 'IOS_APP_TOKEN';
} else {
  appToken = 'ANDROID_APP_TOKEN';
}

let agentConfig : AgentConfiguration = {
  analyticsEventEnabled: false,
  crashReportingEnabled: false,
  interactionTracingEnabled: false,
  networkRequestEnabled: false,
  networkErrorRequestEnabled: false,
  httpResponseBodyCaptureEnabled: false,
  loggingEnabled: false,
  logLevel: NREnums.LogLevel.INFO,
  webViewInstrumentation: false,
  collectorAddress: "",
  crashCollectorAddress: "",
  sendConsoleEvents: false,
  fedRampEnabled: false,
  offlineStorageEnabled: false
}

NewRelicCapacitorPlugin.start({appKey:appToken, agentConfiguration:agentConfig})
```

### Available configurations [#capacitor-configurations]

| Description                                                                                                                                                                                                                                                                       | Example                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| (Android only) Enable or disable collection of event data.                                                                                                                                                                                                                        | ```typescript analyticsEventEnabled: true ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Enable or disable crash reporting.                                                                                                                                                                                                                                                | ```typescript crashReportingEnabled: true ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Enable or disable interaction tracing. Trace instrumentation still occurs, but no traces are harvested. This will disable default and custom interactions.                                                                                                                        | ```typescript interactionTracingEnabled: true ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Enable or disable reporting successful HTTP requests to the `MobileRequest` event type.                                                                                                                                                                                           | ```typescript networkRequestEnabled: true ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Enable or disable reporting network and HTTP request errors to the `MobileRequestError` event type.                                                                                                                                                                               | ```typescript networkErrorRequestEnabled: true ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| Enable or disable capture of HTTP response bodies for HTTP error traces, and `MobileRequestError` events.                                                                                                                                                                         | ```typescript httpResponseBodyCaptureEnabled: true ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Enable or disable agent logging.                                                                                                                                                                                                                                                  | ```typescript loggingEnabled: true ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Specifies the log level. Omit this field for the default log level. Options include: `ERROR` (least verbose), `WARNING`, `INFO`, `VERBOSE`, `AUDIT` (most verbose).                                                                                                               | ```typescript logLevel: NREnums.LogLevel.INFO ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| (iOS only) Enable/Disable automatic instrumentation of `WebViews`.                                                                                                                                                                                                                | ```typescript webViewInstrumentation: true ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| Set a specific collector address for sending data. Omit this field for default address.                                                                                                                                                                                           | ```typescript collectorAddress: "crash-upload-delegate.domain.com" ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Set a specific crash collector address for sending crashes. Omit this field for default address.                                                                                                                                                                                  | ```typescript crashCollectorAddress: "crash-upload-delegate.domain.com" ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| Enable or disable sending JavaScript console logs to New Relic.                                                                                                                                                                                                                   | ```typescript sendConsoleEvents: true ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Enable or disable reporting data using different endpoints for US government clients.                                                                                                                                                                                             | ```typescript fedRampEnabled: false ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Enable or disable offline data storage when no internet connection is available. To configure the amount of offline storage, see [Set max offline storage size](https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/set-max-offline-storage/#capacitor). | Offline storage is enabled by default. To disable it, add the following feature flag: ```typescript offlineStorageEnabled: false ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| Enable or disable background reporting when application goes to the background state.                                                                                                                                                                                             | Background reporting is disabled by default. To enable it, add the following feature flag: ```typescript backgroundReportingEnabled: true ``` To use background instrumentation, you'll need the following in your iOS app project: - In your app's `Info.plist` file, add the key "Permitted background task scheduler identifiers". This key should be an array containing a single string value, which is your app's bundle identifier. - In the **Background Modes** section of Xcode project capabilities, enable **Background Fetch** and **Background Processing**. Note: iOS only guarantees that iOS will harvest in the background once per twenty-four hour period. |

## Cordova

The Cordova agent SDK allows you to configure default settings to change the behavior of the agent.

If you make any changes to the default settings, make sure to add the feature flags just after calling `appToken`. 

Here's a sample configuration:

```shell
# Disable Crash Reporting
cordova plugin add https://github.com/newrelic/newrelic-cordova-plugin.git
  --variable IOS_APP_TOKEN="YOUR_IOS_APP_TOKEN"
  --variable ANDROID_APP_TOKEN="YOUR_ANDROID_APP_TOKEN"
  --variable CRASH_REPORTING_ENABLED="false"
  --variable OFFLINE_STORAGE_ENABLED="false"
```

### Available configurations [#cordova-configurations]

| Description                                                                                                                                                                                                                                                                     | Example                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Enable or disable crash reporting.                                                                                                                                                                                                                                              | ```shell CRASH_REPORTING_ENABLED = "true" ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Enable or disable interaction tracing. Trace instrumentation still occurs, but no traces are harvested. This will disable default and custom interactions.                                                                                                                      | ```shell INTERACTION_TRACING_ENABLED = "true" ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Enable or disable reporting successful HTTP requests to the `MobileRequest` event type.                                                                                                                                                                                         | ```typescript networkRequestEnabled: true ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Enable or disable reporting network and HTTP request errors to the `MobileRequestError` event type.                                                                                                                                                                             | ```typescript networkErrorRequestEnabled: true ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| Enable or disable capture of HTTP response bodies for HTTP error traces, and `MobileRequestError` events.                                                                                                                                                                       | ```typescript httpResponseBodyCaptureEnabled: true ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Enable or disable agent logging.                                                                                                                                                                                                                                                | ```shell LOGGING_ENABLED = "true" ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| Specifies the log level. Omit this field for the default log level. Options include: `ERROR` (least verbose), `WARNING`, `INFO`, `VERBOSE`, `AUDIT` (most verbose).                                                                                                             | ```shell LOG_LEVEL = "INFO" ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| (iOS only) Enable/Disable automatic instrumentation of `WebViews`.                                                                                                                                                                                                              | ```shell WEB_VIEW_INSTRUMENTATION = "true" ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| Set a specific collector address for sending data. Omit this field for default address.                                                                                                                                                                                         | ```shell COLLECTOR_ADDRESS = "crash-upload-delegate.domain.com" ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| Set a specific crash collector address for sending crashes. Omit this field for default address.                                                                                                                                                                                | ```shell CRASH_COLLECTOR_ADDRESS = "crash-upload-delegate.domain.com" ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Enable or disable sending JavaScript console logs to New Relic.                                                                                                                                                                                                                 | ```typescript sendConsoleEvents: true ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Enable or disable reporting data using different endpoints for US government clients.                                                                                                                                                                                           | ```shell FEDRAMP_ENABLED = "false" ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Enable or disable offline data storage when no internet connection is available. To configure the amount of offline storage, see [Set max offline storage size](https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/set-max-offline-storage/#cordova). | Offline storage is enabled by default. To disable it, add the following feature flag: ```shell OFFLINE_STORAGE_ENABLED = "false" ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| Enable or disable background reporting when application goes to the background state.                                                                                                                                                                                           | Background reporting is disabled by default. To enable it, add the following feature flag: ```shell BACKGROUND_REPORTING_ENABLED = "true" ``` To use background instrumentation, you'll need the following in your iOS app project: - In your app's `Info.plist` file, add the key "Permitted background task scheduler identifiers". This key should be an array containing a single string value, which is your app's bundle identifier. - In the **Background Modes** section of Xcode project capabilities, enable **Background Fetch** and **Background Processing**. Note: iOS only guarantees that iOS will harvest in the background once per twenty-four hour period. |

## .NET MAUI

The .NET MAUI agent SDK allows you to configure default settings to change the behavior of the agent.

If you make any changes to the default settings, make sure to add the feature flags just after calling `appToken`.

Here's a sample configuration:

```csharp
using NewRelic.MAUI.Plugin;
...

public static MauiApp CreateMauiApp()
{
  var builder = MauiApp.CreateBuilder();
  builder
    .UseMauiApp<App>()
    .ConfigureFonts(fonts =>
    {
      fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
      fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
    });

      builder.ConfigureLifecycleEvents(AppLifecycle => {
      #if ANDROID
          AppLifecycle.AddAndroid(android => android
              .OnCreate((activity, savedInstanceState) => StartNewRelic()));
      #endif
      #if IOS

            AppLifecycle.AddiOS(iOS => iOS.WillFinishLaunching((_,__) => {
              StartNewRelic();
              return false;
          }));
      #endif
      });
  return builder.Build();
}

private static void StartNewRelic()
{
  CrossNewRelic.Current.HandleUncaughtException();

  // Set optional agent configuration. Options are: 
  // crashReportingEnabled, loggingEnabled, logLevel, collectorAddress, 
  // crashCollectorAddress,analyticsEventEnabled, networkErrorRequestEnabled,
  // networkRequestEnabled, interactionTracingEnabled, webViewInstrumentation,
  // fedRampEnabled, offlineStorageEnabled, newEventSystemEnabled, backgroundReportingEnabled
  // AgentStartConfiguration agentConfig = new AgentStartConfiguration(crashReportingEnabled:false);

  if (DeviceInfo.Current.Platform == DevicePlatform.Android)
  {
    CrossNewRelic.Current.Start("APP_TOKEN_HERE");
    // Start with optional agent configuration
    // CrossNewRelic.Current.Start("APP_TOKEN_HERE", agentConfig);
  } 
  else if (DeviceInfo.Current.Platform == DevicePlatform.iOS)
  {
    CrossNewRelic.Current.Start("APP_TOKEN_HERE");
    // Start with optional agent configuration
    // CrossNewRelic.Current.Start("APP_TOKEN_HERE", agentConfig);
  }
}
```

### Available configurations [#maui-configurations]

| Description                                                                                                                                                                                                                                                                  | Example                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| (Android only) Enable or disable collection of event data.                                                                                                                                                                                                                   | ```csharp analyticsEventEnabled: true ```                                                                                                                                                                                                                                                                                                                                                                                              |
| Enable or disable crash reporting.                                                                                                                                                                                                                                           | ```csharp crashReportingEnabled: true ```                                                                                                                                                                                                                                                                                                                                                                                              |
| Enable or disable agent logging.                                                                                                                                                                                                                                             | ```csharp loggingEnabled: true ```                                                                                                                                                                                                                                                                                                                                                                                                     |
| Enable or disable reporting successful HTTP requests to the `MobileRequest` event type.                                                                                                                                                                                      | ```csharp networkRequestEnabled: true ```                                                                                                                                                                                                                                                                                                                                                                                              |
| Enable or disable reporting network and HTTP request errors to the `MobileRequestError` event type.                                                                                                                                                                          | ```csharp networkErrorRequestEnabled: true ```                                                                                                                                                                                                                                                                                                                                                                                         |
| Enable or disable interaction tracing. Trace instrumentation still occurs, but no traces are harvested. This will disable default and custom interactions. by default false                                                                                                  | ```csharp interactionTracingEnabled: false ```                                                                                                                                                                                                                                                                                                                                                                                         |
| Enable/Disable automatic instrumentation of WebViews.                                                                                                                                                                                                                        | ```csharp webViewInstrumentation: false ```                                                                                                                                                                                                                                                                                                                                                                                            |
| Enable or disable reporting data using different endpoints for US government clients.                                                                                                                                                                                        | ```csharp fedRampEnabled: false ```                                                                                                                                                                                                                                                                                                                                                                                                    |
| Specifies the log level. Omit this field for the default log level. Options include: `ERROR` (least verbose), `WARNING`, `INFO`, `VERBOSE`, `AUDIT` (most verbose).                                                                                                          | ```csharp logLevel: NREnums.LogLevel.INFO ```                                                                                                                                                                                                                                                                                                                                                                                          |
| Set a specific collector address for sending data. Omit this field for default address.                                                                                                                                                                                      | ```csharp collectorAddress: "crash-upload-delegate.domain.com" ```                                                                                                                                                                                                                                                                                                                                                                     |
| Set a specific crash collector address for sending crashes. Omit this field for default address.                                                                                                                                                                             | ```csharp crashCollectorAddress: "crash-upload-delegate.domain.com" ```                                                                                                                                                                                                                                                                                                                                                                |
| Enable or disable offline data storage when no internet connection is available. To configure the amount of offline storage, see [Set max offline storage size](https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/set-max-offline-storage/#maui). | Offline storage is enabled by default. To disable it, add the following feature flag: ```csharp offlineStorageEnabled: false ```                                                                                                                                                                                                                                                                                                       |
| Enable or disable background reporting when application goes to the background state.                                                                                                                                                                                        | Background reporting is disabled by default. To enable it, add the following feature flag: ```csharp backgroundReportingEnabled: true ``` To use background instrumentation, you'll need the following in your iOS app project: - In your app's `Info.plist` file, add the key "Permitted background task scheduler identifiers". This key should be an array containing a single string value, which is your app's bundle identifier. |

## Flutter

The Flutter agent SDK allows you to configure default settings to change the behavior of the agent.

If you make any changes to the default settings, make sure to add the feature flags just after calling `appToken`.

Here's a sample configuration:

```dart
if (Platform.isAndroid) {
  appToken = AppConfig.androidToken;
} else if (Platform.isIOS) {
  appToken = AppConfig.iOSToken;
}

Config config = Config(
    accessToken: appToken,
    analyticsEventEnabled: false,
    networkErrorRequestEnabled: false,
    networkRequestEnabled: false,
    crashReportingEnabled: false,
    interactionTracingEnabled: false,
    httpResponseBodyCaptureEnabled: false,
    loggingEnabled: false,
    webViewInstrumentation: false,
    printStatementAsEventsEnabled: false,
    httpInstrumentationEnabled: false,
    offlineStorageEnabled: true);

// NewrelicMobile.instance.start(config, () {
//   runApp(MyApp());
// });

runZonedGuarded(() async {
  WidgetsFlutterBinding.ensureInitialized();
  FlutterError.onError = NewrelicMobile.onError;
  await NewrelicMobile.instance.startAgent(config);
  runApp(MyApp());
}, (Object error, StackTrace stackTrace) {
  NewrelicMobile.instance.recordError(error, stackTrace);
});
```

### Available configurations [#flutter-configurations]

| Description                                                                                                                                                                                                                                                                                                                       | Example                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| (Android only) Enable or disable collection of event data.                                                                                                                                                                                                                                                                        | ```dart analyticsEventEnabled: true ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Enable or disable crash reporting.                                                                                                                                                                                                                                                                                                | ```dart crashReportingEnabled: true ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Enable or disable interaction tracing. Trace instrumentation still occurs, but no traces are harvested. This will disable default and custom interactions.                                                                                                                                                                        | ```dart interactionTracingEnabled: true ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| Enable or disable reporting successful HTTP requests to the `MobileRequest` event type.                                                                                                                                                                                                                                           | ```dart networkRequestEnabled: true ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Enable or disable reporting network and HTTP request errors to the `MobileRequestError` event type.                                                                                                                                                                                                                               | ```dart networkErrorRequestEnabled: true ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| Enable or disable capture of HTTP response bodies for HTTP error traces, and `MobileRequestError` events.                                                                                                                                                                                                                         | ```dart httpResponseBodyCaptureEnabled: true ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Enable or disable agent logging.                                                                                                                                                                                                                                                                                                  | ```dart loggingEnabled: true ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Specifies the log level. Omit this field for the default log level. Options include: `ERROR` (least verbose), `WARNING`, `INFO`, `VERBOSE`, `AUDIT` (most verbose).                                                                                                                                                               | ```dart logLevel: NREnums.LogLevel.INFO ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| (iOS only) Enable/Disable automatic instrumentation of `WebViews`.                                                                                                                                                                                                                                                                | ```dart webViewInstrumentation: true ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| Set a specific collector address for sending data. Omit this field for default address.                                                                                                                                                                                                                                           | ```dart collectorAddress: "crash-upload-delegate.domain.com" ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Set a specific crash collector address for sending crashes. Omit this field for default address.                                                                                                                                                                                                                                  | ```dart crashCollectorAddress: "crash-upload-delegate.domain.com" ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| Enable or disable sending JavaScript console logs to New Relic.                                                                                                                                                                                                                                                                   | ```dart sendConsoleEvents: true ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| Enable or disable offline data storage when no internet connection is available. To configure the amount of offline storage, see [Set max offline storage size](https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/set-max-offline-storage/#flutter).                                                   | Offline storage is enabled by default. To disable it, add the following feature flag: ```dart offlineStorageEnabled: false ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| Enable or disable the adding of distributed tracing headers to network requests. Default value is `true`. For more information on distributed tracing in mobile apps, see [browser and mobile trace reporting](https://docs.newrelic.com/docs/distributed-tracing/concepts/how-new-relic-distributed-tracing-works#browser-spans) | Distributed tracing is enabled by default. To disable it, add the following feature flag: ```dart distributedTracingEnabled: false ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Enable or disable background reporting when application goes to the background state.                                                                                                                                                                                                                                             | Background reporting is disabled by default. To enable it, add the following feature flag: ```typescript backgroundReportingEnabled: true ``` To use background instrumentation, you'll need the following in your iOS app project: - In your app's `Info.plist` file, add the key "Permitted background task scheduler identifiers". This key should be an array containing a single string value, which is your app's bundle identifier. - In the **Background Modes** section of Xcode project capabilities, enable **Background Fetch** and **Background Processing**. Note: iOS only guarantees that iOS will harvest in the background once per twenty-four hour period. |

## React Native

The React Native agent SDK allows you to configure default settings to change the behavior of the agent.

If you make any changes to the default settings, make sure to add the feature flags just after calling `appToken`.

Here's a sample configuration:

```javascript
import NewRelic from 'newrelic-react-native-agent';
import * as appVersion from './package.json';
import {Platform} from 'react-native';

let appToken;

if (Platform.OS === 'ios') {
  appToken = 'IOS_APP_TOKEN';
} else {
  appToken = 'ANDROID_APP_TOKEN';
}


const agentConfiguration = {
  Config config = Config(
    analyticsEventEnabled: false,
    crashReportingEnabled: false,
    interactionTracingEnabled: false,
    networkRequestEnabled: false,
    networkErrorRequestEnabled: false,
    httpResponseBodyCaptureEnabled: false,
    loggingEnabled: false,
    logLevel: NREnums.LogLevel.INFO,
    webViewInstrumentation: false,
    collectorAddress: "",
    crashCollectorAddress: "",
    sendConsoleEvents: false,
    fedRampEnabled: false,
    offlineStorageEnabled: false,
    jsErrorReportingEnabled: true
  )
};

NewRelic.startAgent(appToken,agentConfiguration);
NewRelic.setJSAppVersion(appVersion.version);
AppRegistry.registerComponent(appName, () => App);
```

### Available configurations [#react-native-configurations]

| Description                                                                                                                                                                                                                                                                                                                                  | Example                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| (Android only) Enable or disable collection of event data.                                                                                                                                                                                                                                                                                   | ```javascript analyticsEventEnabled: true ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Enable or disable crash reporting.                                                                                                                                                                                                                                                                                                           | ```javascript crashReportingEnabled: true ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Enable or disable native crash reporting.                                                                                                                                                                                                                                                                                                    | ```javascript nativeCrashReportingEnabled: true ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| Enable or disable automatic reporting of JavaScript errors as [`MobileJSError` events](/attribute-dictionary/?event=MobileJSError). When enabled, the agent captures unhandled JavaScript errors and reports them without any additional instrumentation. Default value is `true`. Available for React Native agent version 1.9.0 or higher. | ```javascript jsErrorReportingEnabled: true ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| Enable or disable interaction tracing. Trace instrumentation still occurs, but no traces are harvested. This will disable default and custom interactions.                                                                                                                                                                                   | ```javascript interactionTracingEnabled: true ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Enable or disable reporting successful HTTP requests to the `MobileRequest` event type.                                                                                                                                                                                                                                                      | ```javascript networkRequestEnabled: true ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Enable or disable reporting network and HTTP request errors to the `MobileRequestError` event type.                                                                                                                                                                                                                                          | ```javascript networkErrorRequestEnabled: true ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| Enable or disable capture of HTTP response bodies for HTTP error traces, and `MobileRequestError` events.                                                                                                                                                                                                                                    | ```javascript httpResponseBodyCaptureEnabled: true ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Enable or disable agent logging.                                                                                                                                                                                                                                                                                                             | ```javascript loggingEnabled: true ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Specifies the log level. Omit this field for the default log level. Options include: `ERROR` (least verbose), `WARNING`, `INFO`, `VERBOSE`, `AUDIT` (most verbose).                                                                                                                                                                          | ```javascript logLevel: NREnums.LogLevel.INFO ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| (iOS only) Enable/Disable automatic instrumentation of `WebViews`.                                                                                                                                                                                                                                                                           | ```javascript webViewInstrumentation: true ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| Set a specific collector address for sending data. Omit this field for default address.                                                                                                                                                                                                                                                      | ```javascript collectorAddress: "crash-upload-delegate.domain.com" ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Set a specific crash collector address for sending crashes. Omit this field for default address.                                                                                                                                                                                                                                             | ```javascript crashCollectorAddress: "crash-upload-delegate.domain.com" ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| Enable or disable sending JavaScript console logs to New Relic.                                                                                                                                                                                                                                                                              | ```javascript sendConsoleEvents: true ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Enable or disable reporting data using different endpoints for US government clients.                                                                                                                                                                                                                                                        | ```javascript fedRampEnabled: false ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Enable or disable offline data storage when no internet connection is available. To configure the amount of offline storage, see [Set max offline storage size](https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/set-max-offline-storage/#react).                                                                | Offline storage is enabled by default. To disable it, add the following feature flag: ```typescript offlineStorageEnabled: false ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| Enable or disable background reporting when application goes to the background state.                                                                                                                                                                                                                                                        | Background reporting is disabled by default. To enable it, add the following feature flag: ```typescript backgroundReportingEnabled: true ``` To use background instrumentation, you'll need the following in your iOS app project: - In your app's `Info.plist` file, add the key "Permitted background task scheduler identifiers". This key should be an array containing a single string value, which is your app's bundle identifier. - In the **Background Modes** section of Xcode project capabilities, enable **Background Fetch** and **Background Processing**. Note: iOS only guarantees that iOS will harvest in the background once per twenty-four hour period. |

## Unity

New Relic offers default settings for mobile app monitoring in Unity. You can easily adjust these settings within the Unity editor to fit your specific needs.

To configure these settings:

1.  Launch the Unity Editor and open your Unity project.

2.  From the menu bar, select **Tools > New Relic > Getting Started > New Relic Configuration**.

3.  The left-hand **Inspector** window displays a list of default settings. Simply check the box next to a setting to enable it, or uncheck the box to disable it.

    ![Screenshot of the Unity editor to configure settings](https://docs.newrelic.com/images/mobile_screenshot-crop_Unity-editor-UI.webp "Unity editor")

4.  Click **Add component**.

## Unreal Engine

New Relic offers default settings for mobile app monitoring in Unreal Engine. You can easily adjust these settings within the Unreal editor to fit your specific needs.

To configure these settings:

1.  Launch the Unreal Editor and open your Unreal project.

2.  From the menu bar, select **Plugins > New Relic > **.

    ![Screenshot of the Unreal editor to configure settings](https://docs.newrelic.com/images/newrelic_unreal_sdk_configuration.webp "Unreal editor")
