Skip to content

Commit

Permalink
Merge pull request #67 from kthai-nr/add_web_view_flag
Browse files Browse the repository at this point in the history
feat: add web view instrumentation flag
  • Loading branch information
kennyt276 authored Jun 7, 2023
2 parents 2d75db1 + ba9c252 commit a48382f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ Currently, the plugin supports the following agent configuration options:
* `LOG_LEVEL`: Specifies the log level.
* Possible values are `ERROR` (least verbose), `WARNING` `INFO`, `VERBOSE`, `DEBUG`, `AUDIT` (most verbose).
* Defaults to `INFO` on Android and `WARNING` on iOS.
* `WEB_VIEW_INSTRUMENTATION` (iOS ONLY): Enable (default) or disable automatic WKWebView instrumentation.
* Possible values are `true` and `false`. Defaults to `true`.
* `COLLECTOR_ADDRESS`: Specifies the URI authority component of the harvest data upload endpoint.
* `CRASH_COLLECTOR_ADDRESS`: Specifies the authority component of the crash data upload URI.
* `FEDRAMP_ENABLED`: Enable or disable reporting data using different endpoints for US government clients.
Expand Down
3 changes: 3 additions & 0 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<preference name="DEFAULT_INTERACTIONS_ENABLED" default="true" />
<preference name="LOGGING_ENABLED" default="true" />
<preference name="LOG_LEVEL" default="default" />
<preference name="WEB_VIEW_INSTRUMENTATION" default="true" />
<preference name="COLLECTOR_ADDRESS" default="x" />
<preference name="CRASH_COLLECTOR_ADDRESS" default="x" />
<preference name="FEDRAMP_ENABLED" default="false" />
Expand All @@ -46,6 +47,7 @@
<preference name="DEFAULT_INTERACTIONS_ENABLED" value="$DEFAULT_INTERACTIONS_ENABLED" />
<preference name="LOGGING_ENABLED" value="$LOGGING_ENABLED" />
<preference name="LOG_LEVEL" value="$LOG_LEVEL" />
<preference name="WEB_VIEW_INSTRUMENTATION" value="$WEB_VIEW_INSTRUMENTATION" />
<preference name="COLLECTOR_ADDRESS" value="$COLLECTOR_ADDRESS" />
<preference name="CRASH_COLLECTOR_ADDRESS" value="$CRASH_COLLECTOR_ADDRESS" />
<preference name="FEDRAMP_ENABLED" value="$FEDRAMP_ENABLED" />
Expand Down Expand Up @@ -100,6 +102,7 @@
<preference name="DEFAULT_INTERACTIONS_ENABLED" value="$DEFAULT_INTERACTIONS_ENABLED" />
<preference name="LOGGING_ENABLED" value="$LOGGING_ENABLED" />
<preference name="LOG_LEVEL" value="$LOG_LEVEL" />
<preference name="WEB_VIEW_INSTRUMENTATION" value="$WEB_VIEW_INSTRUMENTATION" />
<preference name="COLLECTOR_ADDRESS" value="$COLLECTOR_ADDRESS" />
<preference name="CRASH_COLLECTOR_ADDRESS" value="$CRASH_COLLECTOR_ADDRESS" />
<preference name="FEDRAMP_ENABLED" value="$FEDRAMP_ENABLED" />
Expand Down
3 changes: 3 additions & 0 deletions src/ios/NewRelicCordovaPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ - (void)pluginInitialize
if ([self shouldDisableFeature:config[@"default_interactions_enabled"]]) {
[NewRelic disableFeatures:NRFeatureFlag_DefaultInteractions];
}
if ([self shouldDisableFeature:config[@"web_view_instrumentation"]]) {
[NewRelic disableFeatures:NRFeatureFlag_WebViewInstrumentation];
}
if (![self shouldDisableFeature:config[@"fedramp_enabled"]]) {
[NewRelic enableFeatures:NRFeatureFlag_FedRampEnabled];
}
Expand Down

0 comments on commit a48382f

Please sign in to comment.