diff --git a/cordova/build.sh b/cordova/build.sh
index b171a68f6..3106908b4 100755
--- a/cordova/build.sh
+++ b/cordova/build.sh
@@ -97,6 +97,9 @@ if [ ! -d $PROJECT ]; then
cordova plugin add cordova-plugin-globalization
checkOK
+ cordova plugin add cordova.plugins.diagnostic
+ checkOK
+
cordova plugin add cordova-plugin-splashscreen
checkOK
@@ -190,7 +193,7 @@ if [ $CURRENT_OS == "ANDROID" ]; then
# cp android/AndroidManifest.xml $PROJECT/platforms/android/AndroidManifest.xml
# checkOK
-
+
cp android/build-extras.gradle $PROJECT/platforms/android/build-extras.gradle
checkOK
@@ -243,5 +246,3 @@ if [ $CURRENT_OS == "WP8" ]; then
checkOK
fi
fi
-
-
diff --git a/public/views/preferencesGlobal.html b/public/views/preferencesGlobal.html
index 97234d94f..fd296396c 100644
--- a/public/views/preferencesGlobal.html
+++ b/public/views/preferencesGlobal.html
@@ -48,7 +48,7 @@
Use Unconfirmed Funds
-
+
-
@@ -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 8961d7de2..8cedfe62b 100644
--- a/src/js/controllers/preferencesGlobal.js
+++ b/src/js/controllers/preferencesGlobal.js
@@ -14,12 +14,27 @@ angular.module('copayApp.controllers').controller('preferencesGlobalController',
this.feeOpts = feeService.feeOpts;
this.currentFeeLevel = feeService.getCurrentFeeLevel();
this.usePushNotifications = isCordova && !isMobile.Windows();
+ $scope.PNEnabledByUser = true;
+ $scope.isIOS = isMobile.iOS();
+ if (!typeof cordova.plugins.diagnostic != undefined && $scope.isIOS) {
+ 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;
};
+ 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 = {