@@ -28,6 +28,7 @@ import { LoginManager, LoginTracking } from "react-native-fbsdk-next"
2828import Keychain from "react-native-keychain"
2929import Keys from "react-native-keys"
3030import SiftReactNative from "sift-react-native"
31+ import { v4 as uuidv4 } from "uuid"
3132import { AuthError } from "./AuthError"
3233import { GlobalStore , getCurrentEmissionState } from "./GlobalStore"
3334import type { GlobalStoreModel } from "./GlobalStoreModel"
@@ -1004,12 +1005,14 @@ export const getAuthModel = (): AuthModel => ({
10041005 GlobalStore . actions . artsyPrefs . pushPromptLogic . resetPushPromptLogic ( )
10051006 SiftReactNative . unsetUserId ( )
10061007 SegmentTrackingProvider . identify ?.( undefined , { is_temporary_user : 1 } )
1008+ // Switch to a fresh anonymous Braze user so this device no longer receives
1009+ // push notifications for the logged-out user. The BrazePlugin's identify()
1010+ // skips changeUser when userId is undefined, so we call it explicitly.
1011+ Braze . changeUser ( uuidv4 ( ) )
10071012
1008- // Delete from the server and from Firebase before clearing local storage, so both
1009- // auth token and push token are still available. Deleting the Firebase token forces
1010- // a fresh registration token on the next login (triggering onTokenRefresh).
1013+ // Delete from the server before clearing local storage, so both
1014+ // auth token and push token are still available.
10111015 await deleteToken ( )
1012- // await messaging().deleteToken()
10131016
10141017 await Promise . all ( [
10151018 Platform . OS === "ios"
0 commit comments