Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Commit

Permalink
Clear notifications on log out
Browse files Browse the repository at this point in the history
  • Loading branch information
syoung-smallwisdom committed Sep 29, 2021
1 parent 025b7cc commit 51bed9e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ open class BridgeClientAppManager : ObservableObject {
}

public func signOut() {
localNotificationManager.clearAll()
authManager.signOut()
isOnboardingFinished = false
userSessionInfo = nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ open class LocalNotificationManager : NSObject, UNUserNotificationCenterDelegate
return requests
}

public func clearAll() {
removeAllPendingNotifications() {
}
}

private func removeAllPendingNotifications(_ completionHandler: @escaping (() -> Void)) {
UNUserNotificationCenter.current().getPendingNotificationRequests { (requests) in
let requestIds: [String] = requests.compactMap {
Expand Down

0 comments on commit 51bed9e

Please sign in to comment.