File tree 2 files changed +4
-3
lines changed
2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ describe('APNS', () => {
84
84
'key' : 'value' ,
85
85
'keyAgain' : 'valueAgain'
86
86
} ) ;
87
- expect ( notification . expiry ) . toEqual ( expirationTime ) ;
87
+ expect ( notification . expiry ) . toEqual ( expirationTime / 1000 ) ;
88
88
done ( ) ;
89
89
} ) ;
90
90
@@ -298,7 +298,7 @@ describe('APNS', () => {
298
298
var args = conn . pushNotification . calls . first ( ) . args ;
299
299
var notification = args [ 0 ] ;
300
300
expect ( notification . alert ) . toEqual ( data . data . alert ) ;
301
- expect ( notification . expiry ) . toEqual ( data [ 'expiration_time' ] ) ;
301
+ expect ( notification . expiry ) . toEqual ( data [ 'expiration_time' ] / 1000 ) ;
302
302
var apnDevice = args [ 1 ]
303
303
expect ( apnDevice . connIndex ) . toEqual ( 0 ) ;
304
304
expect ( apnDevice . appIdentifier ) . toEqual ( 'bundleId' ) ;
Original file line number Diff line number Diff line change @@ -201,6 +201,7 @@ function chooseConns(conns, device) {
201
201
/**
202
202
* Generate the apns notification from the data we get from api request.
203
203
* @param {Object } coreData The data field under api request body
204
+ * @param {number } expirationTime The expiration time in milliseconds since Jan 1 1970
204
205
* @returns {Object } A apns notification
205
206
*/
206
207
function generateNotification ( coreData , expirationTime ) {
@@ -231,7 +232,7 @@ function generateNotification(coreData, expirationTime) {
231
232
}
232
233
}
233
234
notification . payload = payload ;
234
- notification . expiry = expirationTime ;
235
+ notification . expiry = expirationTime / 1000 ;
235
236
return notification ;
236
237
}
237
238
You can’t perform that action at this time.
0 commit comments