mirror of
https://github.com/bckelley/cgm-remote-monitor.git
synced 2026-08-24 03:14:12 -05:00
Add sent-at time to notification payload
This commit is contained in:
+5
-1
@@ -112,8 +112,12 @@ function init (env, ctx) {
|
||||
alert += " - " + data.enteredBy
|
||||
}
|
||||
|
||||
// Track time notification was sent
|
||||
let now = new Date()
|
||||
payload['sent-at'] = now.toISOString();
|
||||
|
||||
// Expire after 5 minutes.
|
||||
let expiration = new Date((new Date()).getTime() + 5 * 60 * 1000)
|
||||
let expiration = new Date(now.getTime() + 5 * 60 * 1000)
|
||||
payload['expiration'] = expiration.toISOString();
|
||||
|
||||
let notification = new apn.Notification();
|
||||
|
||||
Reference in New Issue
Block a user