Skip to content

Commit 8bc4e9f

Browse files
committed
Merge branch 'main' into feat/isar-crumbs
2 parents 6c65e57 + ca7f531 commit 8bc4e9f

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@
1010
- We only get the info if online/offline on web platform. The added breadcrumb is set to either `wifi` or `none`.
1111
- APM for isar ([#1726](https://github.com/getsentry/sentry-dart/pull/1726))
1212
- Add isar breadcrumbs ([#1800](https://github.com/getsentry/sentry-dart/pull/1800))
13+
- Starting with Flutter 3.16, Sentry adds the [`appFlavor`](https://api.flutter.dev/flutter/services/appFlavor-constant.html) to the `flutter_context` ([#1799](https://github.com/getsentry/sentry-dart/pull/1799))
14+
15+
### Dependencies
16+
17+
- Bump Android SDK from v7.0.0 to v7.1.0 ([#1788](https://github.com/getsentry/sentry-dart/pull/1788))
18+
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#710)
19+
- [diff](https://github.com/getsentry/sentry-java/compare/7.0.0...7.1.0)
1320

1421
## 7.14.0
1522

flutter/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ android {
6060
}
6161

6262
dependencies {
63-
api 'io.sentry:sentry-android:7.0.0'
63+
api 'io.sentry:sentry-android:7.1.0'
6464
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
6565

6666
// Required -- JUnit 4 framework

flutter/android/src/main/kotlin/io/sentry/flutter/SentryFlutterPlugin.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ import io.sentry.SentryEvent
1919
import io.sentry.SentryLevel
2020
import io.sentry.SentryOptions
2121
import io.sentry.android.core.ActivityFramesTracker
22-
import io.sentry.android.core.AppStartState
2322
import io.sentry.android.core.BuildConfig.VERSION_NAME
2423
import io.sentry.android.core.LoadClass
2524
import io.sentry.android.core.SentryAndroid
2625
import io.sentry.android.core.SentryAndroidOptions
26+
import io.sentry.android.core.performance.AppStartMetrics
2727
import io.sentry.protocol.DebugImage
2828
import io.sentry.protocol.SdkVersion
2929
import io.sentry.protocol.SentryId
@@ -140,8 +140,9 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
140140
result.success(null)
141141
return
142142
}
143-
val appStartTime = AppStartState.getInstance().appStartTime
144-
val isColdStart = AppStartState.getInstance().isColdStart
143+
144+
val appStartTime = AppStartMetrics.getInstance().appStartTimeSpan.startTimestamp
145+
val isColdStart = AppStartMetrics.getInstance().appStartType == AppStartMetrics.AppStartType.COLD
145146

146147
if (appStartTime == null) {
147148
Log.w("Sentry", "App start won't be sent due to missing appStartTime")

flutter/lib/src/event_processor/flutter_enricher_event_processor.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ class FlutterEnricherEventProcessor implements EventProcessor {
153153
// See https://github.com/flutter/flutter/issues/83919
154154
// 'window_is_visible': _window.viewConfiguration.visible,
155155
if (renderer != null) 'renderer': renderer,
156+
if (_appFlavor != null) 'appFlavor': _appFlavor!,
156157
};
157158
}
158159

@@ -266,3 +267,10 @@ class FlutterEnricherEventProcessor implements EventProcessor {
266267
return null;
267268
}
268269
}
270+
271+
/// Copied from https://api.flutter.dev/flutter/services/appFlavor-constant.html
272+
/// As soon as Flutter 3.16 is the minimal supported version of Sentry, this
273+
/// can be replaced with the property from the link above.
274+
const String? _appFlavor = String.fromEnvironment('FLUTTER_APP_FLAVOR') != ''
275+
? String.fromEnvironment('FLUTTER_APP_FLAVOR')
276+
: null;

0 commit comments

Comments
 (0)