diff --git a/CHANGELOG.md b/CHANGELOG.md index 5926976..7a8a28d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## 1.3.1 + +### New in this release +* Upgraded native iOS agent to v7.4.6 +* Added Native C/C++ Crash Capture Support for Android + + ## 1.3.0 ### New in this release diff --git a/NewRelicExampleApp/React-Native-Test-App/index.js b/NewRelicExampleApp/React-Native-Test-App/index.js index 23373f6..3ad89d6 100644 --- a/NewRelicExampleApp/React-Native-Test-App/index.js +++ b/NewRelicExampleApp/React-Native-Test-App/index.js @@ -23,6 +23,10 @@ const agentConfiguration = { // Optional:Enable or disable collection of event data. analyticsEventEnabled: true, + // Android Specific + // Optional:Enable or disable collection of native c/c++ crash. + nativeCrashReportingEnabled: true, + // Optional:Enable or disable crash reporting. crashReportingEnabled: true, diff --git a/README.md b/README.md index 4c5edad..860422d 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,10 @@ import {Platform} from 'react-native'; //Android Specific // Optional:Enable or disable collection of event data. analyticsEventEnabled: true, + + //Android Specific + // Optional:Enable or disable collection of native c/c++ crash. + nativeCrashReportingEnabled: true, // Optional:Enable or disable crash reporting. crashReportingEnabled: true, diff --git a/android/build.gradle b/android/build.gradle index ca7bc01..76a6cc5 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -23,6 +23,8 @@ plugins { def packageJson = PackageJson.getForProject(project) def newrelicVersion = packageJson['sdkVersions']['android']['newrelic'] +def ndkVersion = packageJson['sdkVersions']['android']['ndk'] + project.ext { @@ -30,7 +32,8 @@ project.ext { versions: [ newrelic : [ - android: newrelicVersion + android: newrelicVersion, + ndk:ndkVersion ], ], ]) @@ -76,6 +79,7 @@ dependencies { testImplementation 'junit:junit:4.12' compileOnly 'com.facebook.react:react-native:+' implementation "com.newrelic.agent.android:android-agent:${ReactNative.ext.getVersion("newrelic", "android")}" + implementation "com.newrelic.agent.android:agent-ndk:${ReactNative.ext.getVersion("newrelic", "ndk")}" implementation "com.squareup.okhttp3:okhttp:4.9.1" implementation "com.squareup.okhttp3:okhttp-urlconnection:4.9.1" } diff --git a/android/src/main/java/com/NewRelic/NRMModularAgentModule.java b/android/src/main/java/com/NewRelic/NRMModularAgentModule.java index e2b9e94..e950a0a 100644 --- a/android/src/main/java/com/NewRelic/NRMModularAgentModule.java +++ b/android/src/main/java/com/NewRelic/NRMModularAgentModule.java @@ -91,6 +91,12 @@ public void startAgent(String appKey, String agentVersion, String reactNativeVer NewRelic.disableFeature(FeatureFlag.FedRampEnabled); } + if ((Boolean) agentConfig.get("nativeCrashReportingEnabled")) { + NewRelic.enableFeature(FeatureFlag.NativeReporting); + } else { + NewRelic.disableFeature(FeatureFlag.NativeReporting); + } + Map strToLogLevel = new HashMap<>(); strToLogLevel.put("ERROR", AgentLog.ERROR); strToLogLevel.put("WARNING", AgentLog.WARN); diff --git a/index.js b/index.js index 5c49d58..dff599d 100644 --- a/index.js +++ b/index.js @@ -35,6 +35,7 @@ class NewRelic { this.agentVersion = version; this.agentConfiguration = { analyticsEventEnabled: true, + nativeCrashReportingEnabled: true, crashReportingEnabled: true, interactionTracingEnabled: true, networkRequestEnabled: true, diff --git a/new-relic/__tests__/new-relic.spec.js b/new-relic/__tests__/new-relic.spec.js index 4874999..676b855 100644 --- a/new-relic/__tests__/new-relic.spec.js +++ b/new-relic/__tests__/new-relic.spec.js @@ -83,6 +83,8 @@ describe('New Relic', () => { expect(NewRelic.agentConfiguration.collectorAddress).toBe(""); expect(NewRelic.agentConfiguration.crashCollectorAddress).toBe(""); expect(NewRelic.agentConfiguration.fedRampEnabled).toBe(false); + expect(NewRelic.agentConfiguration.nativeCrashReportingEnabled).toBe(true); + }); it('should change default agent configuration when configuration is passed into the start call', () => { diff --git a/package.json b/package.json index b6886a4..c08bc05 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "newrelic-react-native-agent", - "version": "1.3.0", + "version": "1.3.1", "description": "A New Relic Mobile Agent for React Native", "main": "./index.js", "types": "./dist/index.d.ts", @@ -94,7 +94,8 @@ "newrelic": "7.4.6" }, "android": { - "newrelic": "7.0.0" + "newrelic": "7.0.0", + "ndk":"1.0.3" } } }