diff options
| -rw-r--r-- | ios/MullvadVPN/AppDelegate.swift | 2 | ||||
| -rw-r--r-- | ios/MullvadVPN/NotificationManager.swift | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/ios/MullvadVPN/AppDelegate.swift b/ios/MullvadVPN/AppDelegate.swift index 250333111c..fb8d7d0c63 100644 --- a/ios/MullvadVPN/AppDelegate.swift +++ b/ios/MullvadVPN/AppDelegate.swift @@ -153,7 +153,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { fatalError() } - notificationManager.delegate = connectController?.notificationController notificationManager.notificationProviders = [ AccountExpiryNotificationProvider() ] @@ -245,6 +244,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { private func makeConnectViewController() -> ConnectViewController { let connectController = ConnectViewController() connectController.delegate = self + notificationManager.delegate = connectController.notificationController return connectController } diff --git a/ios/MullvadVPN/NotificationManager.swift b/ios/MullvadVPN/NotificationManager.swift index cf5f2c1450..0204396c57 100644 --- a/ios/MullvadVPN/NotificationManager.swift +++ b/ios/MullvadVPN/NotificationManager.swift @@ -83,6 +83,13 @@ class NotificationManager: NotificationProviderDelegate { willSet { assert(Thread.isMainThread) } + + didSet { + // Pump in-app notifications when changing delegate. + if !inAppNotificationDescriptors.isEmpty { + delegate?.notificationManagerDidUpdateInAppNotifications(self, notifications: inAppNotificationDescriptors) + } + } } func updateNotifications() { |
