I am developing both android and iOS application using the nativescript-angular framework. I am using a nativescript-plugin-firebase plugin for the fcm push notification. In the iOS platform, the notification is coming both in the foreground as well as in the background. But in android, the notification is coming only when the app is in the background.
How do we fix this issue?
My firebase initialization code:
firebase.init({
showNotifications:true,
showNotificationsWhenInForeground:true,
onPushTokenReceivedCallback:(token)=>{
console.log("onPushTokenReceivedCallback:",{token});
},
onMessageReceivedCallback:(message:firebase.Message)=>{
console.log("onMessageReceivedCallback:",{message});
})
.then(()=>{
console.log("Initialized");
})
.catch(error=>{
console.log("Initialize",{ error });
});