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 04:22:43 +0100
committerJules Laplace <jules@okfoc.us>2017-02-19 04:22:43 +0100
commit8f03316d04ba3a51ce16d90ffe94d7611c013652 (patch)
tree1e1282bafc0cf5ec1f9df8f79323fb3ad7388637 /StoneIsland/platforms/ios/www/js/lib/etc/push.js
parented12781e91bb9df05d9b0f927f867d5d3c658f6d (diff)
get rid of old parse plugin
Diffstat (limited to 'StoneIsland/platforms/ios/www/js/lib/etc/push.js')
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/etc/push.js18
1 files changed, 14 insertions, 4 deletions
diff --git a/StoneIsland/platforms/ios/www/js/lib/etc/push.js b/StoneIsland/platforms/ios/www/js/lib/etc/push.js
index e058a3d4..138c4896 100755
--- a/StoneIsland/platforms/ios/www/js/lib/etc/push.js
+++ b/StoneIsland/platforms/ios/www/js/lib/etc/push.js
@@ -23,12 +23,19 @@ var push = (function(){
return
}
console.log("push did initialize")
+ var hub_status = localStorage.getItem("yoox.push_hub")
+ var store_status = localStorage.getItem("yoox.push_store")
+
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.settings.hub = hub_status == "true"
+ push.settings.store = store_status == "true"
- push.subscribe("hub", function(s){ console.log("subscribed to hub", s) })
- push.subscribe("store", function(s){ console.log("subscribed to store", s) })
+ if (! hub_status || hub_status == "true") {
+ push.subscribe("hub")
+ }
+ if (! store_status || store_status == "true") {
+ push.subscribe("store")
+ }
}
push.got_registration = function(data){
var registrationId = data.registrationId
@@ -50,6 +57,9 @@ var push = (function(){
channel: channel,
platform: device.platform,
}
+ pushPlugin.subscribe(channel, function(){
+ console.log("subscribed to", channel)
+ })
$.ajax({
method: "POST",
url: "https://stone.sup.land/_services/push/add",