@@ -22,6 +22,7 @@ import Toast from 'react-native-toast-message';
2222
2323import { store } from './reduxApp' ;
2424import { DSN } from './config' ;
25+ import { SE } from '@env' ; // SE is undefined if no .env file is set
2526
2627const reactNavigationV5Instrumentation = new Sentry . ReactNavigationV5Instrumentation (
2728 {
@@ -30,11 +31,21 @@ const reactNavigationV5Instrumentation = new Sentry.ReactNavigationV5Instrumenta
3031 } ,
3132) ;
3233
34+ // Get app version from package.json, for fingerprinting
35+ const packageJson = require ( '../package.json' ) ;
36+
3337Sentry . init ( {
3438 dsn : DSN ,
3539 environment : "dev" ,
36- beforeSend : ( e ) => {
37- return e ;
40+ beforeSend : ( event ) => {
41+ if ( SE === "tda" ) {
42+ // Make issues unique to the release (app version) for Release Health
43+ event . fingerprint = [ '{{ default }}' , SE , packageJson . version ] ;
44+ } else if ( SE ) {
45+ // Make issue for the SE
46+ event . fingerprint = [ '{{ default }}' , SE ] ;
47+ }
48+ return event ;
3849 } ,
3950 integrations : [
4051 new Sentry . ReactNativeTracing ( {
@@ -52,11 +63,13 @@ Sentry.init({
5263 ] ,
5364 tracesSampleRate : 1.0 ,
5465 enableAutoSessionTracking : true , // For testing, session close when 5 seconds (instead of the default 30) in the background.
55- sessionTrackingIntervalMillis : 5000 ,
66+ sessionTrackingIntervalMillis : 5000 ,
5667 maxBreadcrumbs : 150 , // Extend from the default 100 breadcrumbs.
5768 // debug: true
5869} ) ;
5970
71+ Sentry . setTag ( 'se' , SE ) ;
72+
6073const Stack = createStackNavigator ( ) ;
6174
6275const App = ( ) => {
0 commit comments