@@ -5,6 +5,7 @@ import {defineMessages, type IntlShape} from 'react-intl';
55import { Alert , DeviceEventEmitter , type AlertButton } from 'react-native' ;
66
77import { cancelSessionNotification , findSession } from '@actions/local/session' ;
8+ import { doPing } from '@actions/remote/general' ;
89import { Database , Events } from '@constants' ;
910import { SYSTEM_IDENTIFIERS } from '@constants/database' ;
1011import DatabaseManager from '@database/manager' ;
@@ -18,8 +19,10 @@ import {getCurrentUser} from '@queries/servers/user';
1819import { resetToHome } from '@screens/navigation' ;
1920import EphemeralStore from '@store/ephemeral_store' ;
2021import { getFullErrorMessage , isErrorWithStatusCode , isErrorWithUrl } from '@utils/errors' ;
22+ import { getIntlShape } from '@utils/general' ;
2123import { logWarning , logError , logDebug } from '@utils/log' ;
2224import { scheduleExpiredNotification } from '@utils/notification' ;
25+ import { canReceiveNotifications } from '@utils/push_proxy' ;
2326import { type SAMLChallenge } from '@utils/saml_challenge' ;
2427import { getCSRFFromCookie } from '@utils/security' ;
2528import { getServerUrlAfterRedirect } from '@utils/url' ;
@@ -468,6 +471,19 @@ export const magicLinkLogin = async (serverUrl: string, token: string): Promise<
468471 } ) ;
469472 const csrfToken = await getCSRFFromCookie ( serverUrlToUse ) ;
470473 client . setCSRFToken ( csrfToken ) ;
474+
475+ // Check push notification capability (similar to normal login flow)
476+ const pingResult = await doPing (
477+ serverUrlToUse ,
478+ true , // verifyPushProxy
479+ undefined , // timeoutInterval
480+ undefined , // preauthSecret
481+ client , // client
482+ ) ;
483+ if ( ! pingResult . error && pingResult . canReceiveNotifications ) {
484+ const intl = getIntlShape ( user . locale ) ;
485+ await canReceiveNotifications ( serverUrlToUse , pingResult . canReceiveNotifications as string , intl ) ;
486+ }
471487 } catch ( error ) {
472488 return { error, failed : true } ;
473489 }
0 commit comments