Fixes #1619 - Remove push notification registration on logout

This commit is contained in:
Stefan Ceriu
2023-11-13 10:31:45 +02:00
committed by Stefan Ceriu
parent c438cde085
commit 5e3944c512
2 changed files with 4 additions and 1 deletions

View File

@@ -527,11 +527,13 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationCoordinatorDelegate,
return
}
// The user will log out, clear any existing notifications
// The user will log out, clear any existing notifications and unregister from receving new ones
UNUserNotificationCenter.current().removeAllPendingNotificationRequests()
UNUserNotificationCenter.current().removeAllDeliveredNotifications()
UIApplication.shared.applicationIconBadgeNumber = 0
unregisterForRemoteNotifications()
Task {
// First log out from the server
let accountLogoutURL = await userSession.clientProxy.logout()

1
changelog.d/1619.bugfix Normal file
View File

@@ -0,0 +1 @@
Remove push notification registration on logout