File tree Expand file tree Collapse file tree 4 files changed +704
-206
lines changed Expand file tree Collapse file tree 4 files changed +704
-206
lines changed Original file line number Diff line number Diff line change 1
1
import Foundation
2
2
import Flutter
3
+ import Loans
3
4
4
5
class ScLoanEventsHandler : NSObject {
5
6
@@ -19,7 +20,7 @@ class ScLoanEventsHandler: NSObject {
19
20
20
21
private func setupNotificationListener( ) {
21
22
NotificationCenter . default. addObserver (
22
- forName: Notification . Name ( " scloans_notification " ) ,
23
+ forName: ScLoan . scLoansNotificationName ,
23
24
object: nil ,
24
25
queue: . main
25
26
) { [ weak self] notification in
@@ -30,7 +31,7 @@ class ScLoanEventsHandler: NSObject {
30
31
private func handleNotification( _ notification: Notification ) {
31
32
guard let eventStreamHandler = eventStreamHandler,
32
33
let userInfo = notification. userInfo,
33
- let jsonString = userInfo [ " payload_str " ] as? String else { return }
34
+ let jsonString = userInfo [ ScLoanNotification . strigifiedPayloadKey ] as? String else { return }
34
35
35
36
eventStreamHandler. sendEvent ( jsonString)
36
37
}
Original file line number Diff line number Diff line change 1
1
import Foundation
2
2
import Flutter
3
+ import SCGateway
3
4
4
5
class ScgatewayEventsHandler : NSObject {
5
6
@@ -19,7 +20,7 @@ class ScgatewayEventsHandler: NSObject {
19
20
20
21
private func setupNotificationListener( ) {
21
22
NotificationCenter . default. addObserver (
22
- forName: Notification . Name ( " scg_notification " ) ,
23
+ forName: SCGateway . scgNotificationName ,
23
24
object: nil ,
24
25
queue: . main
25
26
) { [ weak self] notification in
@@ -30,7 +31,7 @@ class ScgatewayEventsHandler: NSObject {
30
31
private func handleNotification( _ notification: Notification ) {
31
32
guard let eventStreamHandler = eventStreamHandler,
32
33
let userInfo = notification. userInfo,
33
- let jsonString = userInfo [ " payload_str " ] as? String else { return }
34
+ let jsonString = userInfo [ SCGNotification . strigifiedPayloadKey ] as? String else { return }
34
35
35
36
eventStreamHandler. sendEvent ( jsonString)
36
37
}
You can’t perform that action at this time.
0 commit comments