• English日本語한국어
  • Log inStart now

iOS agent configuration and feature flags

New Relic's iOS agent provides configuration settings to change the default behavior of the agent. If used, implement these flags just before calling:

  • Objective-C: +[NewRelic startWithApplicationToken:]
  • Swift: NewRelic.start(withApplicationToken:)

Enable or disable 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:

+[NewRelic enableFeatures:(NRMAFeatureFlags)flags];

Disable a feature flag:

+[NewRelic disableFeatures:(NRMAFeatureFlags)flags];

Here is an example where:

  • Interaction tracing and experimental networking instrumentation are enabled.
  • NSURLSession instrumentation and crash reporting are disabled.
[NewRelic enableFeatures:NRFeatureFlag_SwiftInteractionTracing | NRFeatureFlag_ExperimentalNetworkingInstrumentation];
[NewRelic disableFeatures:NRFeatureFlag_NSURLSessionInstrumentation | NRFeatureFlag_CrashReporting];
[NewRelic startWithApplicationToken:...];

Swift

Enable a feature flag:

NewRelic.enableFeatures(NRMAFeatureFlags.[NRMAFeatureFlag])

Disable a feature flag:

NewRelic.disableFeatures(NRMAFeatureFlags.[NRMAFeatureFlag])

Example to disable default interaction tracing:

NewRelic.disableFeatures(NRMAFeatureFlags.NRFeatureFlag_DefaultInteractions)

Crash and error reporting feature flag

If used, be sure to call the feature flag before the New Relic iOS agent start call.

Distributed tracing

Interactions feature flags

If used, be sure to call the feature flag before the New Relic iOS agent start call.

Networking feature flags

If used, be sure to call the feature flag before the New Relic iOS agent start call.

App launch time settings

FedRAMP endpoints settings

Copyright © 2023 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.