feat(mobile): default push notifications to off

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 <help@stably.ai>
This commit is contained in:
Jinwoo-H
2026-05-05 23:34:35 -04:00
co-authored by Orca
parent 3a186e06d3
commit 63e03367ca
2 changed files with 8 additions and 3 deletions
+1 -1
View File
@@ -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(() => {
+7 -2
View File
@@ -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<boolean> {
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
}
}