From 5cca237677f6f89eecfe1d70d74274704beee513 Mon Sep 17 00:00:00 2001 From: Shannon Young Date: Wed, 12 Apr 2023 11:49:54 -0700 Subject: [PATCH] Send notification on signout --- .../Sources/BridgeClientExtension/UploadAppManager.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/SwiftPackage/Sources/BridgeClientExtension/UploadAppManager.swift b/SwiftPackage/Sources/BridgeClientExtension/UploadAppManager.swift index 989af616e..b1a102104 100644 --- a/SwiftPackage/Sources/BridgeClientExtension/UploadAppManager.swift +++ b/SwiftPackage/Sources/BridgeClientExtension/UploadAppManager.swift @@ -292,12 +292,20 @@ open class UploadAppManager : ObservableObject { /// Sign out the current user. @MainActor public final func signOut() { + NotificationCenter.default.post(name: Self.BridgeClientWillSignOut, object: self) willSignOut() updateUserSessionStatus(nil, updateType: .signout) authManager.signOut() didSignOut() + NotificationCenter.default.post(name: Self.BridgeClientDidSignOut, object: self) } + /// A notification that the participant has been signed out. + public static let BridgeClientWillSignOut: Notification.Name = .init("BridgeClientWillSignOut") + + /// A notification that the participant has been signed out. + public static let BridgeClientDidSignOut: Notification.Name = .init("BridgeClientDidSignOut") + /// The current user will sign out. /// @Protected - Only this class should call this method and only subclasses should implement. @MainActor