File tree 2 files changed +21
-7
lines changed
2 files changed +21
-7
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,15 @@ public class PAMUtils {
45
45
payload [ key as! String ] = value
46
46
}
47
47
48
+ var bannerUrl : String ?
49
+ if let flex = flex {
50
+ if let flexView = FlexParser . shared. parse ( flex: flex) as? PContainer {
51
+ if let img = flexView. childs [ 0 ] as? PImage {
52
+ bannerUrl = img. props [ " src " ]
53
+ }
54
+ }
55
+ }
56
+
48
57
return PamPushMessage (
49
58
deliverID: nil ,
50
59
pixel: pixel,
@@ -57,7 +66,8 @@ public class PAMUtils {
57
66
isOpen: false ,
58
67
date: Date ( ) ,
59
68
payload: payload,
60
- pam: nil )
69
+ bannerUrl: bannerUrl
70
+ )
61
71
}
62
72
63
73
return nil
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ public struct PamPushMessage {
19
19
public let isOpen : Bool
20
20
public let date : Date ?
21
21
public let payload : [ String : Any ] ?
22
- public let pam : [ String : Any ] ?
22
+ public let bannerUrl : String ?
23
23
24
24
public func read( ) {
25
25
NotificationAPI . read ( message: self )
@@ -41,13 +41,14 @@ public struct PamPushMessage {
41
41
let thumbnailUrl = item [ " thumbnail_url " ] as? String
42
42
let flex = item [ " flex " ] as? String
43
43
let url = item [ " url " ] as? String
44
- let payload = item [ " json_data " ] as? [ String : Any ]
45
- let pam = item [ " pam " ] as? [ String : Any ]
46
- let popupType = item [ " popupType " ] as? String
44
+
45
+ var payload = item [ " json_data " ] as? [ String : Any ]
46
+ payload = payload ? [ " pam " ] as? [ String : Any ]
47
+
48
+ let popupType = payload ? [ " popupType " ] as? String
47
49
let date = item [ " created_date " ] as? String
48
50
let isOpen = item [ " is_open " ] as? Bool
49
51
var bannerUrl : String ?
50
- _ = bannerUrl;
51
52
52
53
if let flex = flex {
53
54
if let flexView = FlexParser . shared. parse ( flex: flex) as? PContainer {
@@ -57,6 +58,8 @@ public struct PamPushMessage {
57
58
}
58
59
}
59
60
61
+
62
+
60
63
return PamPushMessage (
61
64
deliverID: deliverID,
62
65
pixel: pixel,
@@ -69,7 +72,8 @@ public struct PamPushMessage {
69
72
isOpen: isOpen ?? true ,
70
73
date: PAMUtils . dateFrom ( string: date) ,
71
74
payload: payload,
72
- pam: pam)
75
+ bannerUrl: bannerUrl
76
+ )
73
77
}
74
78
}
75
79
You can’t perform that action at this time.
0 commit comments