diff --git a/public/views/preferencesGlobal.html b/public/views/preferencesGlobal.html index c0df8be0a..6b02229c7 100644 --- a/public/views/preferencesGlobal.html +++ b/public/views/preferencesGlobal.html @@ -78,7 +78,12 @@
About Copay
+
+
Push notifications for Copay are currently disabled. Enable them in the Settings app.
+ +

-
diff --git a/src/js/controllers/preferencesGlobal.js b/src/js/controllers/preferencesGlobal.js index 748da7e39..d6b0634ee 100644 --- a/src/js/controllers/preferencesGlobal.js +++ b/src/js/controllers/preferencesGlobal.js @@ -14,15 +14,25 @@ angular.module('copayApp.controllers').controller('preferencesGlobalController', this.feeOpts = feeService.feeOpts; this.currentFeeLevel = feeService.getCurrentFeeLevel(); this.usePushNotifications = isCordova && !isMobile.Windows(); + if (!typeof cordova.plugins.diagnostic != undefined && isMobile.iOS()) { + cordova.plugins.diagnostic.isRemoteNotificationsEnabled(function(isEnabled) { + $scope.PNEnabledByUser = isEnabled; + }); + } $scope.spendUnconfirmed = config.wallet.spendUnconfirmed; $scope.glideraEnabled = config.glidera.enabled; $scope.glideraTestnet = config.glidera.testnet; $scope.pushNotifications = config.pushNotifications.enabled; - cordova.plugins.diagnostic.isRemoteNotificationsEnabled(function(isEnabled) { - $scope.PNEnabledByUser = isEnabled; - }); }; + this.openSettings = function() { + cordova.plugins.diagnostic.switchToSettings(function() { + $log.debug('switched to settings'); + }, function(err) { + $log.debug(err); + }); + } + var unwatchSpendUnconfirmed = $scope.$watch('spendUnconfirmed', function(newVal, oldVal) { if (newVal == oldVal) return; var opts = {