From 3be2b3aea204f145d6e7c98d835891947105ed0e Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 26 Sep 2017 00:18:58 +0200 Subject: push notification behaviors --- .../ios/Stone Island.xcarchive/Info.plist | 2 +- .../Applications/Stone Island.app/Assets.car | Bin 239992 -> 239992 bytes .../01J-lp-oVM-view-Ze5-6b-2t3.nib | Bin 2284 -> 2286 bytes .../UIViewController-01J-lp-oVM.nib | Bin 832 -> 832 bytes .../Stone Island.app/MainViewController.nib | Bin 943 -> 943 bytes .../Applications/Stone Island.app/Stone Island | Bin 3998144 -> 3998144 bytes .../Stone Island.app/_CodeSignature/CodeResources | 36 ++++++++++----------- .../Applications/Stone Island.app/www/css/nav.css | 5 --- .../Stone Island.app/www/js/lib/etc/push.js | 29 +++++++++++------ .../UserInterfaceState.xcuserstate | Bin 59770 -> 59759 bytes StoneIsland/platforms/ios/www/css/nav.css | 5 --- StoneIsland/platforms/ios/www/js/lib/etc/push.js | 29 +++++++++++------ StoneIsland/www/css/nav.css | 5 --- StoneIsland/www/js/lib/etc/push.js | 31 ++++++++++++------ 14 files changed, 80 insertions(+), 62 deletions(-) diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Info.plist b/StoneIsland/platforms/ios/Stone Island.xcarchive/Info.plist index 1f0dfaa9..b4c661fe 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Info.plist +++ b/StoneIsland/platforms/ios/Stone Island.xcarchive/Info.plist @@ -18,7 +18,7 @@ ArchiveVersion 2 CreationDate - 2017-09-25T17:04:37Z + 2017-09-25T17:20:14Z Name Stone Island SchemeName diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/Assets.car b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/Assets.car index 11472fb5..e8c80428 100644 Binary files a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/Assets.car and b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/Assets.car differ diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/CDVLaunchScreen.storyboardc/01J-lp-oVM-view-Ze5-6b-2t3.nib b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/CDVLaunchScreen.storyboardc/01J-lp-oVM-view-Ze5-6b-2t3.nib index a0e39fd0..e372d277 100644 Binary files a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/CDVLaunchScreen.storyboardc/01J-lp-oVM-view-Ze5-6b-2t3.nib and b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/CDVLaunchScreen.storyboardc/01J-lp-oVM-view-Ze5-6b-2t3.nib differ diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/CDVLaunchScreen.storyboardc/UIViewController-01J-lp-oVM.nib b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/CDVLaunchScreen.storyboardc/UIViewController-01J-lp-oVM.nib index 11a8a0d0..b5ec47bc 100644 Binary files a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/CDVLaunchScreen.storyboardc/UIViewController-01J-lp-oVM.nib and b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/CDVLaunchScreen.storyboardc/UIViewController-01J-lp-oVM.nib differ diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/MainViewController.nib b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/MainViewController.nib index b615db36..12fa41c4 100644 Binary files a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/MainViewController.nib and b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/MainViewController.nib differ diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/Stone Island b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/Stone Island index 6fb3015b..349daaa1 100755 Binary files a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/Stone Island and b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/Stone Island differ diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/_CodeSignature/CodeResources b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/_CodeSignature/CodeResources index bc4e090b..9d041f8f 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/_CodeSignature/CodeResources +++ b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/_CodeSignature/CodeResources @@ -86,11 +86,11 @@ Assets.car - AdU9YWwWWn0LL+gfqyfsiNQzx2E= + c7cQjaJd7R2Nht7YeBCfIriwFIw= CDVLaunchScreen.storyboardc/01J-lp-oVM-view-Ze5-6b-2t3.nib - XMok8vDfArEptCvkn+RMLVR7/jY= + QfKNiUmpkuX2BR116ONpsqXyJ5g= CDVLaunchScreen.storyboardc/Info.plist @@ -98,7 +98,7 @@ CDVLaunchScreen.storyboardc/UIViewController-01J-lp-oVM.nib - GveA29qcysevL9K+WnrL9F0q1Xg= + zwpugbO7/ezK+k04J2eIughVr7Y= CDVNotification.bundle/beep.wav @@ -166,7 +166,7 @@ MainViewController.nib - IxKIz0YfQPNN+CNVoYnjomRkX9M= + rlzpyuixdnUf5Fo0uggUxNCUbzc= PkgInfo @@ -270,7 +270,7 @@ www/css/nav.css - bb7+YzPvUafZeDDeLssmEeR+m5Y= + tNCurPA7ni1EDWw/jvw9w67DpVU= www/css/products.css @@ -498,7 +498,7 @@ www/js/lib/etc/push.js - od1QNWb1S5GRtgwku4lrpTT5z7s= + lXGqoF3JDAFzFbpV0m5Dr7xQ+uY= www/js/lib/nav/AddressView.js @@ -959,22 +959,22 @@ hash - AdU9YWwWWn0LL+gfqyfsiNQzx2E= + c7cQjaJd7R2Nht7YeBCfIriwFIw= hash2 - C0OHLeKT9LD6EwBwIVXEggPz/1HkxQgjlek0ovlHSCE= + q9T5OSlWsvnz4qAma+oOBwTWA6Dichr6tVY6PcMt4qM= CDVLaunchScreen.storyboardc/01J-lp-oVM-view-Ze5-6b-2t3.nib hash - XMok8vDfArEptCvkn+RMLVR7/jY= + QfKNiUmpkuX2BR116ONpsqXyJ5g= hash2 - h65aEdQkRZQfBfcDGeLs5IbMsabOIbaJhUUSkUzA7KQ= + 8FPGjV6ofRu2EkZLf3VsDAkc+b0Gl+dneIgkT3Pjy7s= CDVLaunchScreen.storyboardc/Info.plist @@ -992,11 +992,11 @@ hash - GveA29qcysevL9K+WnrL9F0q1Xg= + zwpugbO7/ezK+k04J2eIughVr7Y= hash2 - nHTJvX2N7mYbW0cvu6MqCoYpfTfUnAYLEUOT9GusDPQ= + WwR6UCvRvU8aw4ifEbhdMUI0nEZPeq0M63tDBGqSGI4= CDVNotification.bundle/beep.wav @@ -1168,11 +1168,11 @@ hash - IxKIz0YfQPNN+CNVoYnjomRkX9M= + rlzpyuixdnUf5Fo0uggUxNCUbzc= hash2 - 9RKL7UWJyeLf50AjlnJsz3PLrbW7BxElXWroJXPfh2o= + Wy+l7QC1BAumuuH/+fYw86ankvdNafN5g8Uwg+H8yCQ= archived-expanded-entitlements.xcent @@ -1443,11 +1443,11 @@ hash - bb7+YzPvUafZeDDeLssmEeR+m5Y= + tNCurPA7ni1EDWw/jvw9w67DpVU= hash2 - aCppewKGWTTfbOS3m6hhUMPCcrQDjf8FAGmWauRasjg= + 2o4b/avhcyA5pKh3T6ScNPY7gsTaD0+B9b8rFdYm+Gc= www/css/products.css @@ -2070,11 +2070,11 @@ hash - od1QNWb1S5GRtgwku4lrpTT5z7s= + lXGqoF3JDAFzFbpV0m5Dr7xQ+uY= hash2 - 6V6mvf2UJ0zXesqTmLPv5RpR2gghv+saPePjoSIPAiI= + PnAVCDHnmi7tyE7sK/K3c/GWhxYZ0pvzP4bY+3mNqYY= www/js/lib/nav/AddressView.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/nav.css b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/nav.css index aee8e21c..28385680 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/nav.css +++ b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/nav.css @@ -17,11 +17,6 @@ -webkit-transform: translateZ(0) translateX(0px); -webkit-transition: -webkit-transform 0.1s; } -.oldios #nav, -.oldios #content { - top: 20px; - height: -webkit-calc(100% - 20px); -} .nav #nav { -webkit-transform: translateZ(0) translateX(0); } diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/etc/push.js b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/etc/push.js index 1606199f..14236728 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/etc/push.js +++ b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/etc/push.js @@ -106,28 +106,39 @@ var push = (function(){ } push.got_push_notification = function(push_obj) { console.log('We received this push notification: ' + JSON.stringify(push_obj)); + window.zsazsa = push_obj app.blog.refresh() + + push_obj.additionalData = push_obj.additionalData || {} + + var is_hub = true try { - var is_hub = JSON.stringify(push_obj || {}).match(/hub/i) - if (is_hub) { - app.intro.$alert.show().html("[ HUB UPDATED ]") - } - else { - auth.clear_cart() - app.intro.$alert.show().html("[ STORE UPDATED ]") - } + is_hub = JSON.stringify(push_obj || {}).match(/hub/i) } catch (e) { + } + + if (is_hub || push_obj.additionalData.url)) { app.intro.$alert.show().html("[ HUB UPDATED ]") } + else { + auth.clear_cart() + app.intro.$alert.show().html("[ STORE UPDATED ]") + } if (push_obj.additionalData.foreground === false) { // TODO: route the user to the uri in push_obj pushPlugin.finish(function(){}, function(){}) } + else if (push_obj.additionalData.url) { + app.router.go(push_obj.additionalData.url) + } + else if (is_hub) { + app.router.go("hub") + } else { - app.route("intro") + app.router.go("intro") } } push.error = function(e){ diff --git a/StoneIsland/platforms/ios/Stone Island.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate b/StoneIsland/platforms/ios/Stone Island.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate index cf672db4..c4d6d031 100644 Binary files a/StoneIsland/platforms/ios/Stone Island.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate and b/StoneIsland/platforms/ios/Stone Island.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/StoneIsland/platforms/ios/www/css/nav.css b/StoneIsland/platforms/ios/www/css/nav.css index aee8e21c..28385680 100755 --- a/StoneIsland/platforms/ios/www/css/nav.css +++ b/StoneIsland/platforms/ios/www/css/nav.css @@ -17,11 +17,6 @@ -webkit-transform: translateZ(0) translateX(0px); -webkit-transition: -webkit-transform 0.1s; } -.oldios #nav, -.oldios #content { - top: 20px; - height: -webkit-calc(100% - 20px); -} .nav #nav { -webkit-transform: translateZ(0) translateX(0); } diff --git a/StoneIsland/platforms/ios/www/js/lib/etc/push.js b/StoneIsland/platforms/ios/www/js/lib/etc/push.js index 1606199f..14236728 100755 --- a/StoneIsland/platforms/ios/www/js/lib/etc/push.js +++ b/StoneIsland/platforms/ios/www/js/lib/etc/push.js @@ -106,28 +106,39 @@ var push = (function(){ } push.got_push_notification = function(push_obj) { console.log('We received this push notification: ' + JSON.stringify(push_obj)); + window.zsazsa = push_obj app.blog.refresh() + + push_obj.additionalData = push_obj.additionalData || {} + + var is_hub = true try { - var is_hub = JSON.stringify(push_obj || {}).match(/hub/i) - if (is_hub) { - app.intro.$alert.show().html("[ HUB UPDATED ]") - } - else { - auth.clear_cart() - app.intro.$alert.show().html("[ STORE UPDATED ]") - } + is_hub = JSON.stringify(push_obj || {}).match(/hub/i) } catch (e) { + } + + if (is_hub || push_obj.additionalData.url)) { app.intro.$alert.show().html("[ HUB UPDATED ]") } + else { + auth.clear_cart() + app.intro.$alert.show().html("[ STORE UPDATED ]") + } if (push_obj.additionalData.foreground === false) { // TODO: route the user to the uri in push_obj pushPlugin.finish(function(){}, function(){}) } + else if (push_obj.additionalData.url) { + app.router.go(push_obj.additionalData.url) + } + else if (is_hub) { + app.router.go("hub") + } else { - app.route("intro") + app.router.go("intro") } } push.error = function(e){ diff --git a/StoneIsland/www/css/nav.css b/StoneIsland/www/css/nav.css index aee8e21c..28385680 100755 --- a/StoneIsland/www/css/nav.css +++ b/StoneIsland/www/css/nav.css @@ -17,11 +17,6 @@ -webkit-transform: translateZ(0) translateX(0px); -webkit-transition: -webkit-transform 0.1s; } -.oldios #nav, -.oldios #content { - top: 20px; - height: -webkit-calc(100% - 20px); -} .nav #nav { -webkit-transform: translateZ(0) translateX(0); } diff --git a/StoneIsland/www/js/lib/etc/push.js b/StoneIsland/www/js/lib/etc/push.js index 1606199f..00a2e839 100755 --- a/StoneIsland/www/js/lib/etc/push.js +++ b/StoneIsland/www/js/lib/etc/push.js @@ -105,29 +105,40 @@ var push = (function(){ return sdk.cms() + '/_services/push/' + key } push.got_push_notification = function(push_obj) { - console.log('We received this push notification: ' + JSON.stringify(push_obj)); + // console.log('We received this push notification: ' + JSON.stringify(push_obj)); + app.blog.refresh() + + push_obj.additionalData = push_obj.additionalData || {} + + var is_hub = true try { - var is_hub = JSON.stringify(push_obj || {}).match(/hub/i) - if (is_hub) { - app.intro.$alert.show().html("[ HUB UPDATED ]") - } - else { - auth.clear_cart() - app.intro.$alert.show().html("[ STORE UPDATED ]") - } + is_hub = JSON.stringify(push_obj || {}).match(/hub/i) } catch (e) { + } + + if (is_hub) { app.intro.$alert.show().html("[ HUB UPDATED ]") } + else if (! push_obj.additionalData.url) { + auth.clear_cart() + app.intro.$alert.show().html("[ STORE UPDATED ]") + } if (push_obj.additionalData.foreground === false) { // TODO: route the user to the uri in push_obj pushPlugin.finish(function(){}, function(){}) } + else if (push_obj.additionalData.url) { + app.router.go(push_obj.additionalData.url) + } + else if (is_hub) { + app.router.go("hub") + } else { - app.route("intro") + app.router.go("intro") } } push.error = function(e){ -- cgit v1.2.3-70-g09d2