Skip to content

Commit

Permalink
Fixes #1573 - Retract all notifications and app badges when signing out
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanceriu committed Sep 6, 2023
1 parent f1758b5 commit e9a945c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ElementX/Sources/Application/AppCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,11 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationCoordinatorDelegate,
return
}

// The user will log out, clear any existing notifications
UNUserNotificationCenter.current().removeAllPendingNotificationRequests()
UNUserNotificationCenter.current().removeAllDeliveredNotifications()
UIApplication.shared.applicationIconBadgeNumber = 0

Task {
// First log out from the server
let accountLogoutURL = await userSession.clientProxy.logout()
Expand Down

0 comments on commit e9a945c

Please sign in to comment.