diff --git a/public/views/preferencesGlobal.html b/public/views/preferencesGlobal.html index 54155c4c3..a2994f6c2 100644 --- a/public/views/preferencesGlobal.html +++ b/public/views/preferencesGlobal.html @@ -48,7 +48,7 @@
Use Unconfirmed Funds
-
  • +
  • Enable notifications
  • diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index 5b9e6a0ba..032a3f663 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -28,9 +28,10 @@ angular.module('copayApp.controllers').controller('indexController', function($r } push.on('registration', function(data) { + var fc = profileService.focusedClient; var opts = {}; var deviceType = (navigator.userAgent.match(/iPhone/i)) == "iPhone" ? "ios" : (navigator.userAgent.match(/Android/i)) == "Android" ? "android" : null; - opts.user = "copayUser"; + opts.user = fc.credentials.copayerId + "||" + fc.credentials.walletId; opts.type = deviceType; opts.token = data.registrationId; storageService.setNotificationsOptions(JSON.stringify(opts), function() { diff --git a/src/js/controllers/preferencesGlobal.js b/src/js/controllers/preferencesGlobal.js index 17095c002..bfb90ddb5 100644 --- a/src/js/controllers/preferencesGlobal.js +++ b/src/js/controllers/preferencesGlobal.js @@ -1,7 +1,7 @@ 'use strict'; angular.module('copayApp.controllers').controller('preferencesGlobalController', - function($scope, $rootScope, $log, configService, uxLanguage) { + function($scope, $rootScope, $log, configService, uxLanguage, isCordova) { this.init = function() { var config = configService.getSync(); @@ -17,6 +17,9 @@ angular.module('copayApp.controllers').controller('preferencesGlobalController', $scope.notifications = config.notifications ? config.notifications.enabled : true; }; + if (isCordova) $scope.mobile = true; + else $scope.mobile = false; + var unwatchSpendUnconfirmed = $scope.$watch('spendUnconfirmed', function(newVal, oldVal) { if (newVal == oldVal) return; var opts = { diff --git a/src/js/services/pushNotificationsService.js b/src/js/services/pushNotificationsService.js index 73076c312..31e41486a 100644 --- a/src/js/services/pushNotificationsService.js +++ b/src/js/services/pushNotificationsService.js @@ -4,11 +4,11 @@ var root = {}; root.subscribe = function(opts) { - return $http.post('http://192.168.1.120:8000/subscribe', opts); + return $http.post('http://192.168.1.126:8000/subscribe', opts); } root.unsubscribe = function(token) { - return $http.post('http://192.168.1.120:8000/unsubscribe', { + return $http.post('http://192.168.1.126:8000/unsubscribe', { token: token }); }