Hi,
I’m trying to use the ionic.io push notification service. It works when the phones on standby/the apps not open - however my on received isnt fireing when a notification comes through.
I have this in my app.js:
$ionicPlatform.ready(function() {
$log.info('firing the run code..');
var push = new Ionic.Push({
"debug": false,
"onNotification": function(notification) {
var payload = notification.payload;
console.log(notification, payload);
$log.info("SOMETHING HAS HAPPENED");
},
"onRegister": function(data) {
console.log(data.token);
},
"pluginConfig": {
"ios": {
"badge": true,
"sound": true
},
"android": {
"iconColor": "#343434"
}
}
});
});
And the register I just have on the login:
var push = new Ionic.Push();
var callback = function(pushToken) {
console.log(pushToken.token);
}
push.register(callback);
However, it does register, i do get the callback token but I never get anything in onNotification