11import "react-native-reanimated" ;
22import "@/i18n" ;
3+ import "@/service/sentry" ;
34
45import {
56 Ubuntu_300Light ,
@@ -18,13 +19,10 @@ import {
1819 ThemeProvider ,
1920} from "@react-navigation/native" ;
2021import * as Sentry from "@sentry/react-native" ;
21- import * as Application from "expo-application" ;
22- import Constants from "expo-constants" ;
2322import * as Notifications from "expo-notifications" ;
2423import { Href , router , Stack } from "expo-router" ;
2524import * as SplashScreen from "expo-splash-screen" ;
2625import { StatusBar } from "expo-status-bar" ;
27- import * as Updates from "expo-updates" ;
2826import { useEffect , useState } from "react" ;
2927import { useColorScheme } from "react-native" ;
3028import { SafeAreaProvider } from "react-native-safe-area-context" ;
@@ -36,78 +34,6 @@ import { useRegisterPushNotifications } from "@/features/notifications/useRegist
3634import { reconfigureApiClient } from "@/service/client" ;
3735import { getNotificationPath } from "@/utils/getNotificationPath" ;
3836
39- const extra = Constants . expoConfig ?. extra as
40- | { gitHash ?: string ; appVariant ?: string }
41- | undefined ;
42- const gitHash = extra ?. gitHash ?? "unknown" ;
43- const appVariant = extra ?. appVariant ?? "unknown" ;
44- // The native binary downloaded from the App Store / Play Store. This stays
45- // fixed across OTA updates, unlike Constants.expoConfig.version which is read
46- // from the (possibly OTA-updated) JS bundle.
47- const nativeAppVersion = Application . nativeApplicationVersion ?? "unknown" ;
48- const nativeBuildVersion = Application . nativeBuildVersion ?? "unknown" ;
49-
50- // Only report from the store-distributed staging and production apps. The dev
51- // tool (a dev client) and local dev builds would otherwise pollute the project
52- // with noise from in-progress work.
53- const sentryEnabled = appVariant === "production" || appVariant === "staging" ;
54-
55- if ( sentryEnabled ) {
56- Sentry . init ( {
57- dsn : "https://7de06aa8cca6dacc9620667dd84a0d01@o782870.ingest.us.sentry.io/4507718344704000" ,
58-
59- environment :
60- process . env . EXPO_PUBLIC_COUCHERS_ENV ??
61- process . env . NEXT_PUBLIC_COUCHERS_ENV ??
62- "dev" ,
63- // release/dist are intentionally left unset so the @sentry /react-native
64- // Expo integration derives them from the native build and OTA update,
65- // matching the values its source-map upload uses. The store-binary and OTA
66- // identities below are surfaced as tags/contexts (which don't affect
67- // symbolication) for searching and filtering.
68- initialScope : {
69- tags : {
70- appVariant,
71- gitHash,
72- nativeAppVersion,
73- nativeBuildVersion,
74- runtimeVersion : Updates . runtimeVersion ?? "unknown" ,
75- updateChannel : Updates . channel ?? "none" ,
76- launchSource : Updates . isEmbeddedLaunch ? "embedded" : "ota" ,
77- } ,
78- contexts : {
79- store_build : {
80- nativeApplicationVersion : nativeAppVersion ,
81- nativeBuildVersion,
82- gitHash,
83- } ,
84- ota : {
85- updateId : Updates . updateId ?? "none" ,
86- channel : Updates . channel ?? "none" ,
87- runtimeVersion : Updates . runtimeVersion ?? "unknown" ,
88- isEmbeddedLaunch : Updates . isEmbeddedLaunch ,
89- createdAt : Updates . createdAt ?. toISOString ( ) ?? "unknown" ,
90- } ,
91- } ,
92- } ,
93-
94- // Adds more context data to events (IP address, cookies, user, etc.)
95- // For more information, visit: https://docs.sentry.io/platforms/react-native/data-management/data-collected/
96- sendDefaultPii : true ,
97-
98- // Enable Logs
99- enableLogs : true ,
100-
101- // Configure Session Replay
102- replaysSessionSampleRate : 0.1 ,
103- replaysOnErrorSampleRate : 1 ,
104- integrations : [
105- Sentry . mobileReplayIntegration ( ) ,
106- Sentry . feedbackIntegration ( ) ,
107- ] ,
108- } ) ;
109- }
110-
11137// Module-level Set to track handled notification IDs (persists across component remounts)
11238const handledNotificationIds = new Set < string > ( ) ;
11339
0 commit comments