• /
  • ログイン
  • 無料アカウント

iOS agent configuration and feature flags

New Relic Mobile'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:)

ヒント

For an explanation of Mobile custom data types, see Add custom data to New Relic Mobile.

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 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.

その他のヘルプ

さらに支援が必要な場合は、これらのサポートと学習リソースを確認してください:

問題を作成するこのページを編集する
Copyright © 2020 New Relic Inc.