diff --git a/src/lib/hooks/useNotificationHandler.ts b/src/lib/hooks/useNotificationHandler.ts index e288ac3a..3f1cd439 100644 --- a/src/lib/hooks/useNotificationHandler.ts +++ b/src/lib/hooks/useNotificationHandler.ts @@ -41,7 +41,7 @@ type NotificationPayload = } const DEFAULT_HANDLER_OPTIONS = { - shouldShowAlert: true, + shouldShowAlert: false, shouldPlaySound: false, shouldSetBadge: true, } diff --git a/src/lib/notifications/notifications.ts b/src/lib/notifications/notifications.ts index 1182bfcb..6f28608f 100644 --- a/src/lib/notifications/notifications.ts +++ b/src/lib/notifications/notifications.ts @@ -71,12 +71,14 @@ export function useNotificationsRegistration() { export function useRequestNotificationsPermission() { const gate = useGate() + const {currentAccount} = useSession() return React.useCallback( async (context: 'StartOnboarding' | 'AfterOnboarding' | 'Login') => { const permissions = await Notifications.getPermissionsAsync() if ( + !currentAccount || !isNative || permissions?.status === 'granted' || (permissions?.status === 'denied' && !permissions?.canAskAgain) @@ -107,7 +109,7 @@ export function useRequestNotificationsPermission() { getPushToken(true) } }, - [gate], + [gate, currentAccount], ) }