From e9a945cfe474be1b965bee75050651ffd5216fc0 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Tue, 5 Sep 2023 15:35:04 +0300 Subject: [PATCH] Fixes #1573 - Retract all notifications and app badges when signing out --- ElementX/Sources/Application/AppCoordinator.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ElementX/Sources/Application/AppCoordinator.swift b/ElementX/Sources/Application/AppCoordinator.swift index a8bfe6294..cfbc6ad1f 100644 --- a/ElementX/Sources/Application/AppCoordinator.swift +++ b/ElementX/Sources/Application/AppCoordinator.swift @@ -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()