diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-12-11 04:35:49 -0600 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-12-11 04:35:49 -0600 |
| commit | 4c2fec26f750e923577217c1b92daa08ec8a458a (patch) | |
| tree | 7b7fe697e547a4c96005b64ee859a8668d0fdacb /StoneIsland/platforms/ios/www/js/lib/etc/push.js | |
| parent | 190e24251c17733eff8fc1b11a077ca2da4b6c4f (diff) | |
improve loading and stuff. ios build 0.3.3
Diffstat (limited to 'StoneIsland/platforms/ios/www/js/lib/etc/push.js')
| -rwxr-xr-x | StoneIsland/platforms/ios/www/js/lib/etc/push.js | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/StoneIsland/platforms/ios/www/js/lib/etc/push.js b/StoneIsland/platforms/ios/www/js/lib/etc/push.js index 15371247..557a718f 100755 --- a/StoneIsland/platforms/ios/www/js/lib/etc/push.js +++ b/StoneIsland/platforms/ios/www/js/lib/etc/push.js @@ -2,7 +2,9 @@ var push = (function(){ var appId var clientKey var push = { settings: {} } + var parsePlugin push.init = function(){ + parsePlugin = window.parsePlugin || { initialize: function(){} } parsePlugin.initialize(appId, clientKey, push.did_initialize, push.error) } push.did_initialize = function() { @@ -44,26 +46,27 @@ var push = (function(){ // } // }, push.error) push.got_push_notification = function(push_obj) { - alert('We received this push notification: ' + JSON.stringify(push_obj)); - app.collection.loaded = false - app.hub.loaded = false + // alert('We received this push notification: ' + JSON.stringify(push_obj)); + app.blog.refresh() + + try { + var is_hub = JSON.stringify(push_obj || {}).match(/hub/i) + if (is_hub) { + app.intro.$alert.show().html("[ HUB UPDATED ]") + } + else { + app.intro.$alert.show().html("[ STORE UPDATED ]") + } + } + catch (e) { + app.intro.$alert.show().html("[ HUB UPDATED ]") + } + if (push_obj.receivedInForeground === false) { // TODO: route the user to the uri in push_obj } else { app.route("intro") - try { - var is_hub = JSON.stringify(push_obj || {}).match(/hub/i) - if (is_hub) { - app.intro.$alert.show().html("[ HUB UPDATED ]") - } - else { - app.intro.$alert.show().html("[ STORE UPDATED ]") - } - } - catch (e) { - app.intro.$alert.show().html("[ HUB UPDATED ]") - } } } push.error = function(e){ |
