mirror of https://github.com/BTCPrivate/copay.git
adding copayersid and walletid to user subscribe json
This commit is contained in:
parent
ca65303941
commit
012fb8021b
|
@ -48,7 +48,7 @@
|
||||||
<switch id="spend-unconfirmed" name="spendUnconfirmed" ng-model="spendUnconfirmed" class="green right"></switch>
|
<switch id="spend-unconfirmed" name="spendUnconfirmed" ng-model="spendUnconfirmed" class="green right"></switch>
|
||||||
<div translate>Use Unconfirmed Funds</div>
|
<div translate>Use Unconfirmed Funds</div>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li ng-show="mobile">
|
||||||
<switch id="enable-notifications" name="notifications" ng-model="notifications" class="green right"></switch>
|
<switch id="enable-notifications" name="notifications" ng-model="notifications" class="green right"></switch>
|
||||||
<div translate>Enable notifications</div>
|
<div translate>Enable notifications</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -28,9 +28,10 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
||||||
}
|
}
|
||||||
|
|
||||||
push.on('registration', function(data) {
|
push.on('registration', function(data) {
|
||||||
|
var fc = profileService.focusedClient;
|
||||||
var opts = {};
|
var opts = {};
|
||||||
var deviceType = (navigator.userAgent.match(/iPhone/i)) == "iPhone" ? "ios" : (navigator.userAgent.match(/Android/i)) == "Android" ? "android" : null;
|
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.type = deviceType;
|
||||||
opts.token = data.registrationId;
|
opts.token = data.registrationId;
|
||||||
storageService.setNotificationsOptions(JSON.stringify(opts), function() {
|
storageService.setNotificationsOptions(JSON.stringify(opts), function() {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('preferencesGlobalController',
|
angular.module('copayApp.controllers').controller('preferencesGlobalController',
|
||||||
function($scope, $rootScope, $log, configService, uxLanguage) {
|
function($scope, $rootScope, $log, configService, uxLanguage, isCordova) {
|
||||||
|
|
||||||
this.init = function() {
|
this.init = function() {
|
||||||
var config = configService.getSync();
|
var config = configService.getSync();
|
||||||
|
@ -17,6 +17,9 @@ angular.module('copayApp.controllers').controller('preferencesGlobalController',
|
||||||
$scope.notifications = config.notifications ? config.notifications.enabled : true;
|
$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) {
|
var unwatchSpendUnconfirmed = $scope.$watch('spendUnconfirmed', function(newVal, oldVal) {
|
||||||
if (newVal == oldVal) return;
|
if (newVal == oldVal) return;
|
||||||
var opts = {
|
var opts = {
|
||||||
|
|
|
@ -4,11 +4,11 @@
|
||||||
var root = {};
|
var root = {};
|
||||||
|
|
||||||
root.subscribe = function(opts) {
|
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) {
|
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
|
token: token
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue