From 63e03367ca0ce7fcf3c53950577eeb97718a96d1 Mon Sep 17 00:00:00 2001 From: Jinwoo-H Date: Tue, 5 May 2026 23:34:35 -0400 Subject: [PATCH] feat(mobile): default push notifications to off MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per App Store guideline 4.5.4 + Apple HIG, the iOS notification permission prompt should fire on user-initiated action, not opportunistically. Previously the toggle defaulted to true and the prompt fired the moment the desktop sent its first notification — reads as unsolicited. Now the toggle defaults to false; the OS prompt only fires when the user explicitly enables notifications in Settings → Notifications. Also fixes a brief 'on' flash on the Notifications screen before the saved preference loads. Co-authored-by: Orca --- mobile/app/notifications.tsx | 2 +- mobile/src/storage/preferences.ts | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/mobile/app/notifications.tsx b/mobile/app/notifications.tsx index 7b0fdf9cd43..d20aacabb3c 100644 --- a/mobile/app/notifications.tsx +++ b/mobile/app/notifications.tsx @@ -13,7 +13,7 @@ import { ensureNotificationPermissions } from '../src/notifications/mobile-notif export default function NotificationsScreen() { const router = useRouter() const insets = useSafeAreaInsets() - const [pushEnabled, setPushEnabled] = useState(true) + const [pushEnabled, setPushEnabled] = useState(false) useFocusEffect( useCallback(() => { diff --git a/mobile/src/storage/preferences.ts b/mobile/src/storage/preferences.ts index efd4dc75c9b..7a588902d86 100644 --- a/mobile/src/storage/preferences.ts +++ b/mobile/src/storage/preferences.ts @@ -4,13 +4,18 @@ const PINS_PREFIX = 'orca:pins:' const PREFS_PREFIX = 'orca:prefs:' const NOTIF_KEY = 'orca:pushNotificationsEnabled' +// Why: default-off so the iOS notification permission prompt never +// fires until the user explicitly opts in via Settings → Notifications. +// Apple's review guideline 4.5.4 and HIG both prefer user-initiated +// permission prompts; default-on would fire the prompt the moment the +// desktop sent its first notification, which can read as unsolicited. export async function loadPushNotificationsEnabled(): Promise { try { const raw = await AsyncStorage.getItem(NOTIF_KEY) - if (raw === null) return true + if (raw === null) return false return raw === 'true' } catch { - return true + return false } }