I’m using this, and it works for registration API, but doesn’t work for unregister API ??
var androidConfig, iosConfig, register;
androidConfig = {
"senderID": "920573560210"
};
iosConfig = {
"badge": true,
"sound": true,
"alert": true
};
register = function(os, token) {
var baseUrl;
baseUrl = 'https://thinkwithsatish.com/pnfw';
if (!baseUrl) {
return $q.reject();
}
return $http({
method: 'POST',
url: baseUrl + '/unregister',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
transformRequest: function(obj) {
var p, str;
str = [];
for (p in obj) {
str.push(encodeURIComponent(p) + '=' + encodeURIComponent(obj[p]));
}
return str.join('&');
},
data: {
os: os,
token: token
}
});
};
$cordovaPush.register(androidConfig).then(function(result) {
$log.debug('android push notification unregistration success', result);
}, function(err) {
$log.error('android push notification unregistration error', err);
});
Please help ..