diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index dd012e694..cd82e3482 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -1289,12 +1289,10 @@ angular.module('copayApp.controllers').controller('indexController', function($r }); $rootScope.$on('Local/UnsubscribeNotifications', function(event, walletId, cb) { - storageService.getDeviceToken(function(err, token) { - pushNotificationsService.unsubscribe(token, walletId, function(err, response) { - if (err) $log.warn('Error: ' + err.code); - $log.debug('Unsubscribed: ' + response); - return cb(); - }); + pushNotificationsService.unsubscribe(walletId, function(err, response) { + if (err) $log.warn('Error: ' + err.code); + $log.debug('Unsubscribed: ' + response); + return cb(); }); }); diff --git a/src/js/services/pushNotificationsService.js b/src/js/services/pushNotificationsService.js index c3d36b3a2..ca4b72370 100644 --- a/src/js/services/pushNotificationsService.js +++ b/src/js/services/pushNotificationsService.js @@ -45,12 +45,10 @@ angular.module('copayApp.services') } root.disableNotifications = function() { - storageService.getDeviceToken(function(err, token) { - lodash.forEach(profileService.getWallets('testnet'), function(wallet) { - root.unsubscribe(token, wallet.id, function(err, response) { - if (err) $log.warn('Error: ' + err.code); - $log.debug('Unsubscribed: ' + response); - }); + lodash.forEach(profileService.getWallets('testnet'), function(wallet) { + root.unsubscribe(wallet.id, function(err, response) { + if (err) $log.warn('Error: ' + err.code); + $log.debug('Unsubscribed: ' + response); }); }); } @@ -63,9 +61,9 @@ angular.module('copayApp.services') }); } - root.unsubscribe = function(token, walletId, cb) { + root.unsubscribe = function(walletId, cb) { var walletClient = profileService.getClient(walletId); - walletClient.pushNotificationsUnsubscribe(token, function(err, resp) { + walletClient.pushNotificationsUnsubscribe(function(err, resp) { if (err) return cb(err); return cb(null, resp); });