I am integrating RTC based audio/video calling feature in my flutter app. For now I am using FCM for push notifications. How can I display incoming call notification and screen like skype & whatsapp on my app when it is closed or in background.
I am sending push notifications using Flutter's firebase_messaging package and I send them in the firebase console. When the app is in the background or when it is closed, I am receiving the notifications, however, when the app is in the foreground it is not working. Please tell me if I need to integrate Javascript to make this feature work, and please reference a resource that I can use in order to figure out how I can integrate Javascript with fcm as I haven't found a way to do this with flutter.
I figured out that someone can use the flutter local notifications plugin so that when the push notification is sent and the app is on the foreground, normally no notification would be delivered to the system tray, but using the flutter local notifications plugin, it would be possible to send a local notification when the app is on the foreground.
To Understand better.
Have a look into this table.
https://pub.dev/packages/firebase_messaging#receiving-messages
It states that when your Android or iOS Application is in foreground, OnMessage callback is called if you are sending notification payload or data payload as notification body.
You are receiving notifications when your app is in background because, when an app is in background notification is send to system tray and OS (Android or iOS) handle it for you. And your app is launched when you click on notification from system tray.
When your app is in foreground you have to catch notification payload in onMessage and handle it explicitly, you can create local notification in this case.
We recently integrated firebase to out react native apps on android and ios for push notifications using react-native-firebase. Since we do not currently have the fcm tokens and we can only obtain them once a user opens the app once again. Is there a way to send notifications to all the users or to schedule a local notification using react-native-firebase without the user opening the app so that we can obtain the fcm token for the device.
I'm using Firebase for push notification. Problem is i want to send push notification for some mobile phones but when i'm sending push notification it will send notification to all installed mobile app
You would need to get the mobile token and then store it somewhere on your server.
Then you can send to specific devices using the mobile token.
Just in case, i actually wrote a full guide on how to implement push notifications to your ionic app here
I want to create an andriod ongoing notification that will always stay on the top of all other notification including notifications that will arrive after the notification were shown.
What should I do to acheive this behaviour?