diff --git a/ElementX/Sources/Services/Notification/Manager/NotificationManager.swift b/ElementX/Sources/Services/Notification/Manager/NotificationManager.swift index fa7a7a5edc..37d175f935 100644 --- a/ElementX/Sources/Services/Notification/Manager/NotificationManager.swift +++ b/ElementX/Sources/Services/Notification/Manager/NotificationManager.swift @@ -23,7 +23,18 @@ final class NotificationManager: NSObject, NotificationManagerProtocol { private let notificationCenter: UserNotificationCenterProtocol private let appSettings: AppSettings - private var userSession: UserSessionProtocol? + private var userSession: UserSessionProtocol? { + didSet { + // If notification permissions were given previously then attempt re-registering + // for remote notifications on startup. Otherwise let the onboarding flow handle it + Task { @MainActor in + if await self.notificationCenter.authorizationStatus() == .authorized { + self.delegate?.registerForRemoteNotifications() + } + } + } + } + private var cancellables = Set() private var notificationsEnabled = false diff --git a/changelog.d/2602.bugfix b/changelog.d/2602.bugfix new file mode 100644 index 0000000000..7ddc99da75 --- /dev/null +++ b/changelog.d/2602.bugfix @@ -0,0 +1 @@ +Fix pushers not being registered on re-login after recent Onboarding changes \ No newline at end of file