File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ describe('APNS', () => {
8484 'key' : 'value' ,
8585 'keyAgain' : 'valueAgain'
8686 } ) ;
87- expect ( notification . expiry ) . toEqual ( expirationTime ) ;
87+ expect ( notification . expiry ) . toEqual ( expirationTime / 1000 ) ;
8888 done ( ) ;
8989 } ) ;
9090
@@ -298,7 +298,7 @@ describe('APNS', () => {
298298 var args = conn . pushNotification . calls . first ( ) . args ;
299299 var notification = args [ 0 ] ;
300300 expect ( notification . alert ) . toEqual ( data . data . alert ) ;
301- expect ( notification . expiry ) . toEqual ( data [ 'expiration_time' ] ) ;
301+ expect ( notification . expiry ) . toEqual ( data [ 'expiration_time' ] / 1000 ) ;
302302 var apnDevice = args [ 1 ]
303303 expect ( apnDevice . connIndex ) . toEqual ( 0 ) ;
304304 expect ( apnDevice . appIdentifier ) . toEqual ( 'bundleId' ) ;
Original file line number Diff line number Diff line change @@ -201,6 +201,7 @@ function chooseConns(conns, device) {
201201/**
202202 * Generate the apns notification from the data we get from api request.
203203 * @param {Object } coreData The data field under api request body
204+ * @param {number } expirationTime The expiration time in milliseconds since Jan 1 1970
204205 * @returns {Object } A apns notification
205206 */
206207function generateNotification ( coreData , expirationTime ) {
@@ -231,7 +232,7 @@ function generateNotification(coreData, expirationTime) {
231232 }
232233 }
233234 notification . payload = payload ;
234- notification . expiry = expirationTime ;
235+ notification . expiry = expirationTime / 1000 ;
235236 return notification ;
236237}
237238
You can’t perform that action at this time.
0 commit comments