File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,16 @@ final class PushNotificationsManager: PushNotesManager {
1313 ///
1414 let configuration : PushNotificationsConfiguration
1515
16+ /// Mutable reference to `foregroundNotifications`.
17+ private let foregroundNotificationsSubject = PublishSubject < ForegroundNotification > ( )
18+
19+ /// An observable that emits values when the Remote Notifications are received while the app is
20+ /// in the foreground.
21+ ///
22+ var foregroundNotifications : Observable < ForegroundNotification > {
23+ foregroundNotificationsSubject
24+ }
25+
1626 /// Returns the current Application's State
1727 ///
1828 private var applicationState : UIApplication . State {
@@ -253,6 +263,8 @@ private extension PushNotificationsManager {
253263
254264 if let foregroundNotification = ForegroundNotification . from ( userInfo: userInfo) {
255265 configuration. application. presentInAppNotification ( message: foregroundNotification. message)
266+
267+ foregroundNotificationsSubject. send ( foregroundNotification)
256268 }
257269
258270 synchronizeNotifications ( completionHandler: completionHandler)
Original file line number Diff line number Diff line change @@ -3,6 +3,11 @@ import UIKit
33
44protocol PushNotesManager {
55
6+ /// An observable that emits values when the Remote Notifications are received while the app is
7+ /// in the foreground.
8+ ///
9+ var foregroundNotifications : Observable < ForegroundNotification > { get }
10+
611 /// Resets the Badge Count.
712 ///
813 func resetBadgeCount( )
You can’t perform that action at this time.
0 commit comments