Hi Team,
I have implemented push notification its working properly android in both foreground / background state and but in IOS onNotification doesn’t trigger when the app is in foreground or background but its working only if app is killed only.
team can you please me why onNotification not fire in foreground?
this.fcm.onNotification().subscribe(data => {
if(data.wasTapped){
console.log(data.wasTapped);
//redirectPageViaNotificationType for redirect page...
this.redirectPageViaNotificationType(data);
} else {
//Notification was received in foreground. Maybe the user needs to be notified
// if application open, show
let confirmAlert = this.alertCtrl.create({
title: (<any>data).title,
message: (<any>data).body,
buttons: [{
text: 'Ignore',
role: 'cancel'
},{
text: 'View',
handler: () => {
//redirectPageViaNotificationType for redirect page...
this.redirectPageViaNotificationType(data);
}
}]
});
confirmAlert.present();
}
});