summaryrefslogtreecommitdiff
path: root/lib/okpush/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/okpush/index.js')
-rw-r--r--lib/okpush/index.js16
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/okpush/index.js b/lib/okpush/index.js
index a9ba12eb..a509c891 100644
--- a/lib/okpush/index.js
+++ b/lib/okpush/index.js
@@ -69,6 +69,7 @@ function OKPush (options) {
// pass in admin middleware!
router.get('/admin', function (req, res) {
+ // change this to get notification counts for each channel
db.getNotifications(function(err, notes){
db.getDeviceCount(function(err, count){
var data = {
@@ -100,14 +101,17 @@ function OKPush (options) {
// should work without middleware
router.post('/add', function (req, res) {
- // add a key
- db.
- registrationId: localStorage.getItem("yoox.registrationId"),
- channel: channel,
- platform,
+ db.addToken({
+ token: req.body.registrationId,
+ channel: req.body.channel,
+ platform: req.body.platform,
+ })
})
router.post('/remove', function (req, res) {
- // remove a key
+ db.removeToken({
+ token: req.body.registrationId,
+ channel: req.body.channel,
+ })
})
this._router = router