diff --git a/cordova/build.sh b/cordova/build.sh index c4be3d920..b171a68f6 100755 --- a/cordova/build.sh +++ b/cordova/build.sh @@ -103,13 +103,10 @@ if [ ! -d $PROJECT ]; then cordova plugin add cordova-plugin-statusbar checkOK - cordova plugin add cordova-plugin-customurlscheme --variable URL_SCHEME=bitcoin - checkOK - cordova plugin add phonegap-plugin-push@1.2.3 checkOK - cordova plugin add https://github.com/EddyVerbruggen/LaunchMyApp-PhoneGap-Plugin.git --variable URL_SCHEME=bitcoin + cordova plugin add cordova-plugin-customurlscheme --variable URL_SCHEME=bitcoin checkOK cordova plugin add cordova-plugin-inappbrowser diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index cd82e3482..a7fc1c4b4 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -5,6 +5,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r var SOFT_CONFIRMATION_LIMIT = 12; self.isCordova = isCordova; self.isChromeApp = isChromeApp; + self.pushDeviceType = isMobile.iOS() || isMobile.Android(); self.isSafari = isMobile.Safari(); self.onGoingProcess = {}; self.historyShowLimit = 10; @@ -12,7 +13,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r self.prevState = 'walletHome'; document.addEventListener('deviceready', function() { - if (isMobile.Android() || isMobile.iOS()) { + if (self.pushDeviceType) { storageService.getDeviceToken(function(err, token) { $timeout(function() { if (!token) pushNotificationsService.pushNotificationsInit(); @@ -1285,7 +1286,9 @@ angular.module('copayApp.controllers').controller('indexController', function($r }); $rootScope.$on('Local/SubscribeNotifications', function(event) { - pushNotificationsService.enableNotifications(); + if (self.pushDeviceType) { + pushNotificationsService.enableNotifications(); + } }); $rootScope.$on('Local/UnsubscribeNotifications', function(event, walletId, cb) {