@@ -15,6 +15,7 @@ import { setNotificationHandler } from "expo-notifications/build/NotificationsHa
1515import scheduleNotificationAsync from "expo-notifications/build/scheduleNotificationAsync" ;
1616import setNotificationChannelAsync from "expo-notifications/build/setNotificationChannelAsync" ;
1717import { Platform } from "react-native" ;
18+ import { readEnvFlag } from "../utils/env" ;
1819import {
1920 buildReminderScheduleRequests ,
2021 enabledReminderMinutes ,
@@ -25,9 +26,14 @@ import {
2526const MANAGED_NOTIFICATION_SOURCE = "eclipse-timer" ;
2627const ANDROID_CHANNEL_ID = "eclipse-alerts" ;
2728const MAX_SCHEDULED_NOTIFICATIONS_PER_SYNC = 60 ;
29+ const SKIP_PERMISSION_PROMPT_FLAG = "EXPO_PUBLIC_SKIP_NOTIFICATION_PERMISSION_PROMPT" ;
2830
2931let hasConfiguredHandler = false ;
3032
33+ export function shouldSkipNotificationPermissionPrompt ( ) {
34+ return readEnvFlag ( SKIP_PERMISSION_PROMPT_FLAG ) ;
35+ }
36+
3137export type NotificationSchedulingSettings = {
3238 vibrationEnabled : boolean ;
3339 soundEnabled : boolean ;
@@ -130,6 +136,7 @@ export function configureNotificationPresentationHandler() {
130136export async function ensureNotificationPermissionAsync ( ) {
131137 const current = await getPermissionsAsync ( ) ;
132138 if ( current . granted || current . status === "granted" ) return true ;
139+ if ( shouldSkipNotificationPermissionPrompt ( ) ) return false ;
133140
134141 const requested = await requestPermissionsAsync ( {
135142 ios : {
0 commit comments