diff --git a/ElementX/Sources/Application/AppCoordinator.swift b/ElementX/Sources/Application/AppCoordinator.swift index 2cbc672da..f8d56edb2 100644 --- a/ElementX/Sources/Application/AppCoordinator.swift +++ b/ElementX/Sources/Application/AppCoordinator.swift @@ -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() diff --git a/changelog.d/1619.bugfix b/changelog.d/1619.bugfix new file mode 100644 index 000000000..2de929316 --- /dev/null +++ b/changelog.d/1619.bugfix @@ -0,0 +1 @@ +Remove push notification registration on logout \ No newline at end of file