Hi all,
I succesfully implemented the ionic push notifications using the ionic push service and following the documentation.
At the moment I’m testing the application just on android.
The only problem that I found is that upon receiving a notification this appears in the android notifications drawer but in the application the “onNotification” event isn’t triggered.
The event is triggered just once the notification icon gets double tapped.
I really thought that the onNotification event would be triggered on the exact receive moment. Am I wrong?
This is the code of my register function:
pushRegister: function () {
console.log('Ionic Push: Registering user');
// Register with the Ionic Push service. All parameters are optional.
$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) {
//alert(notification);
console.log("IN NOTIFICATION");
console.log(notification);
return true;
}
});
}