-
-
Notifications
You must be signed in to change notification settings - Fork 285
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Upgrade Sentry + add screenshots (#4566)
* Upgrade Sentry + add screenshots * Upgrade iOS & macOS dependencies * Remove unused variable
- Loading branch information
Showing
7 changed files
with
104 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ import 'dart:async'; | |
import 'package:flutter/foundation.dart'; | ||
import 'package:matomo_tracker/matomo_tracker.dart'; | ||
import 'package:openfoodfacts/openfoodfacts.dart'; | ||
import 'package:package_info_plus/package_info_plus.dart'; | ||
import 'package:sentry_flutter/sentry_flutter.dart'; | ||
import 'package:smooth_app/data_models/preferences/user_preferences.dart'; | ||
import 'package:smooth_app/helpers/global_vars.dart'; | ||
|
@@ -195,19 +194,28 @@ class AnalyticsHelper { | |
static Future<void> initSentry({ | ||
required Function()? appRunner, | ||
}) async { | ||
final PackageInfo packageInfo = await PackageInfo.fromPlatform(); | ||
|
||
await SentryFlutter.init( | ||
(SentryOptions options) { | ||
options.dsn = | ||
'https://[email protected]/5376745'; | ||
options.sentryClientName = | ||
'sentry.dart.smoothie/${packageInfo.version}'; | ||
options | ||
..dsn = | ||
'https://[email protected]/5376745' | ||
..beforeSend = ( | ||
SentryEvent event, { | ||
Hint? hint, | ||
}) async { | ||
return event.copyWith( | ||
tags: <String, String>{ | ||
'store': GlobalVars.storeLabel.name, | ||
'scanner': GlobalVars.scannerLabel.name, | ||
}, | ||
); | ||
}; | ||
// To set a uniform sample rate | ||
options.tracesSampleRate = 1.0; | ||
options.beforeSend = _beforeSend; | ||
options.environment = | ||
'${GlobalVars.storeLabel.name}-${GlobalVars.scannerLabel.name}'; | ||
options | ||
..tracesSampleRate = 1.0 | ||
..beforeSend = _beforeSend | ||
..environment = | ||
'${GlobalVars.storeLabel.name}-${GlobalVars.scannerLabel.name}'; | ||
}, | ||
appRunner: appRunner, | ||
); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.