Skip to content

Commit

Permalink
feat:added backgroundReporting and NewEventSystem Configuration (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
ndesai-newrelic committed Jun 3, 2024
1 parent 7792e72 commit 539f3f9
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 4 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

# 6.2.10

* Improvements

The native iOS Agent has been updated to version 7.4.12, bringing performance enhancements and bug fixes.

* New Features

A new backgroundReportingEnabled feature flag has been introduced to enable background reporting functionality.
A new newEventSystemEnabled feature flag has been added to enable the new event system.


# 6.2.9
* A crash issue in the iOS app has been resolved when the Cordova agent receives responses in the form of blobs or array buffers.
* The native iOS agent has been updated to version 7.4.11, which brings performance enhancements and bug fixes.
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ Currently, the plugin supports the following agent configuration options:
* Possible values are `true` and `false`. Defaults to `false`.
* `OFFLINE_STORAGE_ENABLED`: Enable or disable offline data storage when no internet connection is available. .
* Possible values are `true` and `false`. Defaults to `true`.
* `NEW_EVENT_SYSTEM_ENABLED`: Enable or disable to use our new, more stable, event system for iOS agent.
* Possible values are `true` and `false`. Defaults to `true`.
* `BACKGROUND_REPORTING_ENABLED`: Enable or disable Background Events Reporting when the app is in the background.
* Possible values are `true` and `false`. Defaults to `false`.

# Updating the plugin
Update the New Relic Cordova plugin to the latest released version easily via the following command:
```
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "newrelic-cordova-plugin",
"version": "6.2.9",
"version": "6.2.10",
"description": "New Relic Cordova Plugin for iOS and Android",
"repo": "https://github.com/newrelic/newrelic-cordova-plugin/",
"scripts": {
Expand Down
12 changes: 9 additions & 3 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<?xml version="1.0" encoding="UTF-8"?>

<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
id="newrelic-cordova-plugin" version="6.2.9">
id="newrelic-cordova-plugin" version="6.2.10">
<name>NewRelic</name>
<description>New Relic Cordova Plugin for iOS and Android</description>
<author>New Relic</author>
Expand All @@ -31,7 +31,8 @@
<preference name="FEDRAMP_ENABLED" default="false" />
<preference name="OFFLINE_STORAGE_ENABLED" default="true" />
<preference name="CONSOLE_LOGS_ENABLED" default="true" />

<preference name="NEW_EVENT_SYSTEM_ENABLED" default="true" />
<preference name="BACKGROUND_REPORTING_ENABLED" default="false" />

<platform name="ios">
<preference name="IOS_APP_TOKEN" default="x" />
Expand All @@ -56,6 +57,8 @@
<preference name="FEDRAMP_ENABLED" value="$FEDRAMP_ENABLED" />
<preference name="OFFLINE_STORAGE_ENABLED" value="$OFFLINE_STORAGE_ENABLED" />
<preference name="CONSOLE_LOGS_ENABLED" value="$CONSOLE_LOGS_ENABLED" />
<preference name="NEW_EVENT_SYSTEM_ENABLED" value="$NEW_EVENT_SYSTEM_ENABLED" />
<preference name="BACKGROUND_REPORTING_ENABLED" value="$BACKGROUND_REPORTING_ENABLED" />
<param name="ios-package" value="NewRelicCordovaPlugin" onload="true" />
</feature>
</config-file>
Expand All @@ -73,7 +76,7 @@
<source url="https://cdn.cocoapods.org/" />
</config>
<pods use-frameworks="true">
<pod name="NewRelicAgent" spec="7.4.11" />
<pod name="NewRelicAgent" spec="7.4.12" />
</pods>
</podspec>

Expand Down Expand Up @@ -113,6 +116,9 @@
<preference name="FEDRAMP_ENABLED" value="$FEDRAMP_ENABLED" />
<preference name="OFFLINE_STORAGE_ENABLED" value="$OFFLINE_STORAGE_ENABLED" />
<preference name="CONSOLE_LOGS_ENABLED" value="$CONSOLE_LOGS_ENABLED" />
<preference name="NEW_EVENT_SYSTEM_ENABLED" value="$NEW_EVENT_SYSTEM_ENABLED" />
<preference name="BACKGROUND_REPORTING_ENABLED" value="$BACKGROUND_REPORTING_ENABLED" />

</config-file>

<source-file src="src/android/NewRelicCordovaPlugin.java"
Expand Down
8 changes: 8 additions & 0 deletions src/ios/NewRelicCordovaPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ - (void)pluginInitialize
if (![self shouldDisableFeature:config[@"offline_storage_enabled"]]) {
[NewRelic enableFeatures:NRFeatureFlag_OfflineStorage];
}

if (![self shouldDisableFeature:config[@"background_reporting_enabled"]]) {
[NewRelic enableFeatures:NRFeatureFlag_BackgroundReporting];
}

if (![self shouldDisableFeature:config[@"new_event_system_enabled"]]) {
[NewRelic enableFeatures:NRFeatureFlag_NewEventSystem];
}

// Set log level depending on loggingEnabled and logLevel
NRLogLevels logLevel = NRLogLevelWarning;
Expand Down

0 comments on commit 539f3f9

Please sign in to comment.