Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Notification not showing in background IONIC3 .
Hello community, I am facing an issue !! I am developping an hybrid app in ionic3 and I need to implement push notification, I use as backend liferay6.2. And everything seems fine cause I can now send messages from Cloud Messaging in firebase console.And My phone receuives the message when I am in foreground or background mode ,The problem is that when I try to send from push notification module in liferay, I receive the message in foreground but when I kill the app or I turn to background mode I receive nothing.Any help please, The code of on('notification') below :
pushObject.on('notification').subscribe((notification: any) => {
//if user using app and push notification comes
if (notification.additionalData.foreground) {
// if application open, show popup
let confirmAlert = this.alertCtrl.create({
title: 'New Notification',
message: notification.message,
buttons: [{
text: 'Ignore',
role: 'cancel'
}, {
text: 'View',
handler: () => {
alert("Hello World");
}
}]
});
confirmAlert.present();
} else {
//if user NOT using app and push notification comes
//TODO: Your logic on click of push notification directly
// this.nav.push(DetailsPage, { message: data.message });
alert('Push notification clicked');
console.log('Push notification clicked');
}
console.log('Received a notification', JSON.stringify(notification))
});
Thank you in advance
Hey
In which platform are you observing this behavior?
Powered by Liferay™