summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/ios/www/js/lib/etc/push.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2017-02-19 03:54:21 +0100
committerJules Laplace <jules@okfoc.us>2017-02-19 03:54:21 +0100
commited12781e91bb9df05d9b0f927f867d5d3c658f6d (patch)
treef95a2744e8b375d3b129fb8b5489b7cc9d6034be /StoneIsland/platforms/ios/www/js/lib/etc/push.js
parente4757225a537b2382d2dfab28e2751152cdfcdb9 (diff)
open workspace file NOT project file
Diffstat (limited to 'StoneIsland/platforms/ios/www/js/lib/etc/push.js')
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/etc/push.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/StoneIsland/platforms/ios/www/js/lib/etc/push.js b/StoneIsland/platforms/ios/www/js/lib/etc/push.js
index bf7185e6..e058a3d4 100755
--- a/StoneIsland/platforms/ios/www/js/lib/etc/push.js
+++ b/StoneIsland/platforms/ios/www/js/lib/etc/push.js
@@ -1,6 +1,4 @@
var push = (function(){
- var appId = "GS82ZxpN8Mecpc53rsyu6aLLGK0W4CKi42J25DLB"
- var clientKey = "hQRtQfsgimYnX5PMivtcdXCG9eZhESeyTr0Rd8Sv"
var push = { settings: {} }
var pushPlugin
push.init = function(){
@@ -14,11 +12,9 @@ var push = (function(){
},
})
- push.settings.requested = localStorage.getItem("yoox.push_requested") == "true"
- push.settings.hub = localStorage.getItem("yoox.push_hub") == "true"
- push.settings.store = localStorage.getItem("yoox.push_store") == "true"
+ console.log("push init")
- pushPlugin.hasPermission(push.did_initialize)
+ PushNotification.hasPermission(push.did_initialize)
pushPlugin.on('registration', push.got_registration)
pushPlugin.on('notification', push.got_push_notification)
}
@@ -26,9 +22,13 @@ var push = (function(){
if (! data.isEnabled) {
return
}
+ console.log("push did initialize")
push.settings.requested = localStorage.getItem("yoox.push_requested") == "true"
push.settings.hub = localStorage.getItem("yoox.push_hub") == "true"
push.settings.store = localStorage.getItem("yoox.push_store") == "true"
+
+ push.subscribe("hub", function(s){ console.log("subscribed to hub", s) })
+ push.subscribe("store", function(s){ console.log("subscribed to store", s) })
}
push.got_registration = function(data){
var registrationId = data.registrationId