Hi guys!
I am trying to send push notifications to an android device.
I have set everything and followed this tutorial like 10 times now, but I always get this error: Request Failed with status code of 404
This is my code
Ionic.io();
var push = new Ionic.Push({
"debug":false,
"onNotification": function (notification) {
alert('Received notification');
},
"pluginConfig": {
"android": {
"iconColor": "#0000FF"
}
}
});
var user = Ionic.User.current();
if (!user.id) {
user.id = Ionic.User.anonymousId();
}
user.set('name', 'Ruben El Bueno');
user.set('bio', 'This is my bio');
var success = function(response) {
$scope.data.user_id = response;
console.log('user was saved');
};
var failure = function(error) {
$scope.data.user_id = "Not" + error;
};
user.save().then(success, failure);
var callback = function () {
push.addTokenToUser(user);
user.save();
}
push.register(callback);
But I keep getting the same error.
I also tried clearing the Mobile Device cache like posted here
Please help!
Thanks guys!