I can't answer incoming call when app is closed completely Twilio Flutter - flutter

I'm using Android 11 and using the https://pub.dev/packages/twilio_voice package for Twilio Call Function
I am getting an incoming call notification when the app is completely closed but nothing is happening when I try to click the answer button in the notification. and if I click on the notification incoming call screen pop up and when I click the answer button popup closes and nothing is happening. I want the flutter app to open like normal notifications and answer the call.

Related

How to execute actionStream on a notification when application is in terminated state with awesome_notifications in flutter?

I have a flutter application that receives FCM Data messages.
On each data message, I create a respective notification locally using the awesome_notifications library. I have 2 action buttons on the notification. The action button click navigates me to a specific page when the application is in the foreground or background(paused).
But, the same click action doesn't work when the app is terminated/killed. Instead of navigating to some page, it just opens the application's homepage.
I'm listening to actionStream, but it seems it doesn't work when the app is terminated.
If anyone has a solution to this, it would be beneficial!

Get all notification messages (if any) when the app is opened using app icon

I was working with flutter and I managed to implement FCM push notification in the app. The FLUTTER_NOTIFICATION_CLICK click_action works fine.
But, I need to perform that similar action when the app is launched by clicking the app icon. Is there any method to do so?
Ultimate goal is to perform similar action when the app is launched by clicking the notification or by the app icon (from the app drawer). Please help me with this.
As far as I know, there is no way to get the received notification content when the app is opened using app icon in Flutter. I tried to find a method, but as of now, I am at zero.
Flutter with FCM supports only onLaunch and onResume click_action events for notifications. If you are able to write some native code, I think you may be able to do this. A simple work around I can give is that :
You can clear the notifications as soon as the app is opened using NotificationManager in Android. Here is the reference.
After that you can fetch the actual notification messages from your server(if there is one) and show it to the user.
This is not an accurate answer. But this is what I finally did. Not sure if this helps.
If you click and launch from notification
You can listen that 'onLaunch' method in firebaseMessaging.configure
But from 'app icon' is no way as far as I know.

Automatically open a screen in flutter app on getting a background push notification

I want to know if the following is possible in flutter using flutter firebase messaging (FCM)
Scenario:
The app is closed or killed. A firebase push message is sent to the device (or device is listening on some topic etc.). The app gets the notification in the background and based on a flag in the data, either shows a notification in the notification tray or opens the app and displays a modal dialog to alert the user of an emergency notification. This has to happen automatically without having the user to click on the notification
Use case,
Any notification with medium severity that comes in can be displayed as a notification in the notification tray. The user can click on it and open the app whenever he wants to
Any notification with critical severity and which requires immediate user attention needs to automatically show a modal dialog with some buttons to enable the user to take action. It must play some sound to get the users attention.
I have done this in android previously where we used to get the notification in the notification handler and then based on the incoming message data, we used to either show a notification or show a dialog.

An alert like whatsapp when app is in background in ionic

I am using One Signal push notifications in my ionic app. I want to show an alert when i receive a notification when my app is in background.
I tried using the platform pause and remuse functionality to check for background and foreground and then generate an alert when app was in background using ionic alert controller but was not able to produce the desired result.
I want a pop up dialog box like one in whastapp when u receive a message.
Can anyone please suggest a solution to this.
There is no way to achieve what you're trying to achieve through the use of OneSignal alone. The OneSignal plugin for Ionic has two calls to action:
handleNotificationReceived() & handleNotificationOpened()
The first one is called when the notification is received and the app is in the foreground.
And the second is called when the app is launched from the notification.
You would need some other service to record when notifications are sent to see if there were any when the app was launched by itself. If you use OneSignal's REST API to send notifications yourself, you can record when a notification is sent, and then when the app is launched by itself, you can fetch missed notifications or notification count from your own server. That's just one way you can do it.
But OneSignal is a push notification service, which send notifications. Even if you did FCM yourself and went through the scenario you mentioned, the results would be the same.
It's not a OneSignal issue. It's the way notifications are designed.

phonegap ios) is it possible distinguish push notification that user clicked?

I am using phonegap push notification plugin and all seems work fine. push comes without any problem.
But the problem is there is nothing I can do when app is back-grounded.
multiple push notifications can arrive when app is backgrounded. I can not expect which push
notification user going to click. Whatever notification user clicks, app will be resumed without
information of user selection. I have to trigger different events depanding on what nofitication
user selected. I need to know what notification user selected when app is resumed but don't
know how to... seems very tricky problem. is there anybody had same problem?
how did you guys handle this problem?
any help will be appriciated.
never mind...
I thought window.plugins.pushNotifiction.getPendingNotification would return all pending
notifications which arrived while app is background.
But getPendingNotification function only returns the notification that user selected on
notification center or mobile screen.
well... seems nice..
you can`t get all notification information which fire during application is off or app. is in background but, you can fetch user info shortly receive notification in native iOS app.
please follow this application:didFinishLaunchingWithOptions.
At first call of launch you can check for options and retrive the user-info.
for more info refer above link.