Skip to content

Commit

Permalink
fix : Fixed issue in Flutter agent causing appbuild and appversion fi…
Browse files Browse the repository at this point in the history
…elds to overwrite for mobile-handled exceptions.#65 (#67)
  • Loading branch information
ndesai-newrelic committed Nov 7, 2023
1 parent b6bc3fa commit 95c9bb0
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 14 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.5

* Fixed issue in Flutter agent causing appbuild and appversion fields to overwrite for iOS mobile-handled exceptions.

## 1.0.4

* Upgraded native Android agent to v7.1.0
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Install NewRelic plugin into your dart project by adding it to dependecies in yo
```yaml

dependencies:
newrelic_mobile: 1.0.4
newrelic_mobile: 1.0.5

```
Expand Down
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ android {
}

defaultConfig {
minSdkVersion 16
minSdkVersion 24
}
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.newrelic.agent.android:android-agent:7.1.0'
implementation 'com.newrelic.agent.android:android-agent:7.0.0'

}
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ class NewrelicMobilePlugin : FlutterPlugin, MethodCallHandler {
applicationToken
).withLoggingEnabled(loggingEnabled!!)
.withLogLevel(5)
.withApplicationFramework(ApplicationFramework.Flutter, "1.0.4").start(context)
.withApplicationFramework(ApplicationFramework.Flutter, "1.0.5").start(context)
NewRelic.setAttribute("DartVersion", dartVersion)
StatsEngine.get().inc("Supportability/Mobile/Android/Flutter/Agent/1.0.4");
StatsEngine.get().inc("Supportability/Mobile/Android/Flutter/Agent/1.0.5");
result.success("Agent Started")
}
"setUserId" -> {
Expand Down
5 changes: 1 addition & 4 deletions ios/Classes/SwiftNewrelicMobilePlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,17 +110,14 @@ public class SwiftNewrelicMobilePlugin: NSObject, FlutterPlugin {
let reason = args!["reason"] as? String
let fatal = args!["fatal"] as? Bool
let stackTraceElements = args!["stackTraceElements"] as? [[String : Any]] ?? [[String : Any]]()
let version = Bundle.main.infoDictionary?["CFBundleVersion"] ?? "1.0.3"


let attributes: [String:Any] = [
"name": exceptionMessage ?? "Exception name not found",
"reason": reason ?? "Reason not found",
"cause": reason ?? "Reason not found",
"fatal": fatal ?? false,
"stackTraceElements": stackTraceElements,
"appBuild": version,
"appVersion": version
"stackTraceElements": stackTraceElements
]

NewRelic.recordHandledException(withStackTrace: attributes)
Expand Down
2 changes: 1 addition & 1 deletion ios/newrelic_mobile.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#
Pod::Spec.new do |s|
s.name = 'newrelic_mobile'
s.version = '1.0.4'
s.version = '1.0.5'
s.summary = 'Flutter plugin for NewRelic Mobile.'
s.description = <<-DESC
Flutter plugin for NewRelic Mobile.
Expand Down
2 changes: 1 addition & 1 deletion lib/newrelic_mobile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class NewrelicMobile {
await NewrelicMobile.instance.startAgent(config);
runApp();
await NewrelicMobile.instance
.setAttribute("Flutter Agent Version", "1.0.4");
.setAttribute("Flutter Agent Version", "1.0.5");
}, (Object error, StackTrace stackTrace) {
NewrelicMobile.instance.recordError(error, stackTrace);
FlutterError.presentError(
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: newrelic_mobile
description: Flutter plugin for NewRelic Mobile. This plugin allows you to instrument Flutter apps with help of native New Relic Android and iOS agents.
version: 1.0.4
version: 1.0.5

homepage: https://github.com/newrelic/newrelic-flutter-agent

Expand Down
4 changes: 2 additions & 2 deletions test/newrelic_mobile_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -946,7 +946,7 @@ void main() {

final Map<String, dynamic> attributeParams = <String, dynamic>{
'name': 'Flutter Agent Version',
'value': '1.0.4',
'value': '1.0.5',
};

expect(methodCalLogs, <Matcher>[
Expand Down Expand Up @@ -993,7 +993,7 @@ void main() {

final Map<String, dynamic> attributeParams = <String, dynamic>{
'name': 'Flutter Agent Version',
'value': '1.0.4',
'value': '1.0.5',
};

expect(methodCalLogs, <Matcher>[
Expand Down

0 comments on commit 95c9bb0

Please sign in to comment.