@@ -155,6 +155,10 @@ class IterableInAppMessage {
155
155
* Whether this inbox message has been read
156
156
*/
157
157
readonly read : boolean
158
+ /**
159
+ * the priority value this in-app message has
160
+ */
161
+ readonly priorityLevel : number
158
162
159
163
constructor ( messageId : string ,
160
164
campaignId : number ,
@@ -164,7 +168,8 @@ class IterableInAppMessage {
164
168
saveToInbox : boolean ,
165
169
inboxMetadata : IterableInboxMetadata | undefined ,
166
170
customPayload : any | undefined ,
167
- read : boolean ) {
171
+ read : boolean ,
172
+ priorityLevel : number ) {
168
173
this . campaignId = campaignId
169
174
this . messageId = messageId
170
175
this . trigger = trigger
@@ -174,6 +179,7 @@ class IterableInAppMessage {
174
179
this . inboxMetadata = inboxMetadata
175
180
this . customPayload = customPayload
176
181
this . read = read
182
+ this . priorityLevel = priorityLevel
177
183
}
178
184
179
185
isSilentInbox ( ) : boolean {
@@ -186,11 +192,13 @@ class IterableInAppMessage {
186
192
const trigger = IterableInAppTrigger . fromDict ( dict [ "trigger" ] )
187
193
let createdAt = dict [ "createdAt" ]
188
194
if ( createdAt ) {
189
- createdAt = new Date ( createdAt as number )
195
+ var dateObject = new Date ( 0 )
196
+ createdAt = dateObject . setUTCMilliseconds ( createdAt )
190
197
}
191
198
let expiresAt = dict [ "expiresAt" ]
192
199
if ( expiresAt ) {
193
- expiresAt = new Date ( expiresAt as number )
200
+ var dateObject = new Date ( 0 )
201
+ expiresAt = dateObject . setUTCMilliseconds ( expiresAt )
194
202
}
195
203
let saveToInbox = IterableUtil . readBoolean ( dict , "saveToInbox" )
196
204
let inboxMetadataDict = dict [ "inboxMetadata" ]
@@ -203,6 +211,8 @@ class IterableInAppMessage {
203
211
let customPayload = dict [ "customPayload" ]
204
212
let read = IterableUtil . readBoolean ( dict , "read" )
205
213
214
+ let priorityLevel = dict [ "priorityLevel" ] as number
215
+
206
216
return new IterableInAppMessage (
207
217
messageId ,
208
218
campaignId ,
@@ -212,7 +222,8 @@ class IterableInAppMessage {
212
222
saveToInbox ,
213
223
inboxMetadata ,
214
224
customPayload ,
215
- read
225
+ read ,
226
+ priorityLevel
216
227
)
217
228
}
218
229
0 commit comments