From d4995d47b99d5e9564abfed2218f4a23df75983b Mon Sep 17 00:00:00 2001 From: Hannah Jin Date: Wed, 2 Oct 2024 11:37:07 -0700 Subject: [PATCH] Add more parameters (androidAppId and iosBundleId) in devtools events. (#295) Co-authored-by: Andrew Kolos --- pkgs/unified_analytics/CHANGELOG.md | 3 ++- pkgs/unified_analytics/lib/src/constants.dart | 2 +- pkgs/unified_analytics/lib/src/event.dart | 7 +++++++ pkgs/unified_analytics/pubspec.yaml | 2 +- pkgs/unified_analytics/test/event_test.dart | 6 +++++- 5 files changed, 16 insertions(+), 4 deletions(-) diff --git a/pkgs/unified_analytics/CHANGELOG.md b/pkgs/unified_analytics/CHANGELOG.md index 80d889fe6..86d0110a4 100644 --- a/pkgs/unified_analytics/CHANGELOG.md +++ b/pkgs/unified_analytics/CHANGELOG.md @@ -1,7 +1,8 @@ -## 6.1.4-wip +## 6.1.4 - Fix formatting and remove dependency on `package:intl`. - Remove direct usage of `package:path` in favor of `package:file`. +- Added `androidAppId` and `iosBundleId` to the `Event.devtoolsEvent` constructor. ## 6.1.3 diff --git a/pkgs/unified_analytics/lib/src/constants.dart b/pkgs/unified_analytics/lib/src/constants.dart index fefa5413b..fde9c21b3 100644 --- a/pkgs/unified_analytics/lib/src/constants.dart +++ b/pkgs/unified_analytics/lib/src/constants.dart @@ -87,7 +87,7 @@ const int kMaxLogFileSize = 25 * (1 << 20); const String kLogFileName = 'dart-flutter-telemetry.log'; /// The current version of the package, should be in line with pubspec version. -const String kPackageVersion = '6.1.4-wip'; +const String kPackageVersion = '6.1.4'; /// The minimum length for a session. const int kSessionDurationMinutes = 30; diff --git a/pkgs/unified_analytics/lib/src/event.dart b/pkgs/unified_analytics/lib/src/event.dart index 0713a3816..a24fe0c3a 100644 --- a/pkgs/unified_analytics/lib/src/event.dart +++ b/pkgs/unified_analytics/lib/src/event.dart @@ -399,6 +399,10 @@ final class Event { int? rootSetCount, int? rowCount, int? inspectorTreeControllerId, + + // DeepLinkScreenMetrics + String? androidAppId, + String? iosBundleId, }) : eventName = DashEvent.devtoolsEvent, eventData = { 'eventCategory': eventCategory, @@ -446,6 +450,9 @@ final class Event { if (rowCount != null) 'rowCount': rowCount, if (inspectorTreeControllerId != null) 'inspectorTreeControllerId': inspectorTreeControllerId, + // DeepLinkScreenMetrics + if (androidAppId != null) 'androidAppId': androidAppId, + if (iosBundleId != null) 'iosBundleId': iosBundleId, }; /// Event that contains the results for a specific doctor validator. diff --git a/pkgs/unified_analytics/pubspec.yaml b/pkgs/unified_analytics/pubspec.yaml index 34cb046d0..172f5b289 100644 --- a/pkgs/unified_analytics/pubspec.yaml +++ b/pkgs/unified_analytics/pubspec.yaml @@ -5,7 +5,7 @@ description: >- # LINT.IfChange # When updating this, keep the version consistent with the changelog and the # value in lib/src/constants.dart. -version: 6.1.4-wip +version: 6.1.4 # LINT.ThenChange(lib/src/constants.dart) repository: https://github.com/dart-lang/tools/tree/main/pkgs/unified_analytics diff --git a/pkgs/unified_analytics/test/event_test.dart b/pkgs/unified_analytics/test/event_test.dart index a9538e885..1e9344fa2 100644 --- a/pkgs/unified_analytics/test/event_test.dart +++ b/pkgs/unified_analytics/test/event_test.dart @@ -587,6 +587,8 @@ void main() { rootSetCount: 123, rowCount: 123, inspectorTreeControllerId: 123, + androidAppId: 'androidAppId', + iosBundleId: 'iosBundleId', ); final constructedEvent = generateEvent(); @@ -622,7 +624,9 @@ void main() { expect(constructedEvent.eventData['rootSetCount'], 123); expect(constructedEvent.eventData['rowCount'], 123); expect(constructedEvent.eventData['inspectorTreeControllerId'], 123); - expect(constructedEvent.eventData.length, 28); + expect(constructedEvent.eventData['androidAppId'], 'androidAppId'); + expect(constructedEvent.eventData['iosBundleId'], 'iosBundleId'); + expect(constructedEvent.eventData.length, 30); }); test('Confirm all constructors were checked', () {