summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js/lib/etc/push.js
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/www/js/lib/etc/push.js')
-rwxr-xr-xStoneIsland/www/js/lib/etc/push.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/StoneIsland/www/js/lib/etc/push.js b/StoneIsland/www/js/lib/etc/push.js
index 138c4896..da63fdd1 100755
--- a/StoneIsland/www/js/lib/etc/push.js
+++ b/StoneIsland/www/js/lib/etc/push.js
@@ -1,7 +1,11 @@
var push = (function(){
- var push = { settings: {} }
+ var push = { settings: {}, disabled: false }
var pushPlugin
push.init = function(){
+ if (device.platform !== "ios") {
+ push.disabled = true
+ return
+ }
pushPlugin = PushNotification.init({
ios: {
@@ -50,6 +54,7 @@ var push = (function(){
}
}
push.subscribe = function(channel, cb){
+ if (push.disabled) return
push.settings[channel] = true
localStorage.setItem("yoox.push_" + channel, "true")
var data = {
@@ -73,6 +78,7 @@ var push = (function(){
})
}
push.unsubscribe = function(channel, cb){
+ if (push.disabled) return
push.settings[channel] = false
localStorage.setItem("yoox.push_" + channel, "false")
var data = {