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

Commit

Permalink
Merge pull request #78 from Sage-Bionetworks/clear-notifications
Browse files Browse the repository at this point in the history
Clear notifications on log out
  • Loading branch information
syoung-smallwisdom authored Sep 29, 2021
2 parents 025b7cc + 51bed9e commit 09b4e8f
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 09b4e8f

Please sign in to comment.