2015-12-23 12:29:46 -03:00
|
|
|
'use strict';
|
|
|
|
|
angular.module('copayApp.services')
|
|
|
|
|
.factory('pushNotificationsService', function($http) {
|
|
|
|
|
var root = {};
|
|
|
|
|
|
|
|
|
|
root.subscribe = function(opts) {
|
2015-12-28 12:32:01 -03:00
|
|
|
return $http.post('http://192.168.1.126:8000/subscribe', opts);
|
2015-12-23 12:29:46 -03:00
|
|
|
}
|
|
|
|
|
|
2015-12-23 15:33:56 -03:00
|
|
|
root.unsubscribe = function(token) {
|
2015-12-28 12:32:01 -03:00
|
|
|
return $http.post('http://192.168.1.126:8000/unsubscribe', {
|
2015-12-23 15:33:56 -03:00
|
|
|
token: token
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2015-12-23 12:29:46 -03:00
|
|
|
return root;
|
|
|
|
|
|
|
|
|
|
});
|