Hello Ionic Team.
Im using ionic push notification its working fine both platform few day back but now its working in android only. I’m not even change single file. once i push the notification using this curl code terminal.
curl -u SKEY: -H “Content-Type: application/json” -H “X-Ionic-Application-Id: APP ID” https://push.ionic.io/api/v1/push -d ‘{“tokens”:[“DEVICE TOKEN”],“notification”:{“alert”:“Hello World!”,“android”:{“collapseKey”:“foo”,“delayWhileIdle”:true,“timeToLive”:300,“payload”:{“key1”:“value”,“key2”:“value”}}}}’
foreground mode its shows alert “Hello world!” but not in background mode. while background mode im getting console like this
Calling onNotification() for a development push. Payload will NOT be available ionic-push.js:115
Object {alert: “Hello World!”} app.js:116
$ionicPush: No device, sending alert instead. ionic-push.js:133
app.js file code snippet
$ionicPush.register({
canShowAlert: true, //Can pushes show an alert on your screen?
canSetBadge: true, //Can pushes update app icon badges?
canPlaySound: true, //Can notifications play a sound?
canRunActionsOnWake: true, //Can run actions outside the app,
onNotification: function(notification) {
console.log(notification) **Line 116**
if(notification.event=='message') {
//Im doing some page reduction stuff here.
}
return true;
}
});
Cheers
VK