From c43a11d64751b824c098db9a00b63c3e65866ae7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Tue, 9 Feb 2016 15:43:11 -0300 Subject: [PATCH] refactor ios payload structure --- lib/pushnotificationsservice.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/pushnotificationsservice.js b/lib/pushnotificationsservice.js index 4b068ae..96231c6 100644 --- a/lib/pushnotificationsservice.js +++ b/lib/pushnotificationsservice.js @@ -125,13 +125,18 @@ PushNotificationsService.prototype._sendPushNotifications = function(notificatio "title": content.plain.subject, "message": content.plain.body, "walletId": sjcl.hash.sha256.hash(notification.walletId), - "notId": Math.floor(Math.random()*100000)+1 + "notId": Math.floor(Math.random() * 100000) + 1 } }; - opts.ios = { - "alert": content.plain.body, - "sound": "default" + "alert": { + "title": content.plain.subject, + "body": content.plain.body + }, + "sound": "default", + "payload": { + "walletId": sjcl.hash.sha256.hash(notification.walletId) + } }; return next(err, opts); }, next);