-
-
Notifications
You must be signed in to change notification settings - Fork 265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can't navigate to call screen after picking call from notification when app is killed #454
Comments
You can save the call data in shared preferences and when the flutter app opens, you can read from the call data shared preferences and then pick up the call.
|
@victortive shared one way to get it done. Another way is to run the SIP as a background service. |
I tried both but nothing worked |
when reconnect sip after have notification, tell server send the call again, this'll work. i solved this |
The best way is keep connect socket (Use flutter_foreground_task), listen state call in background and show notification when call coming. |
@pogenz45 TaskHandler will be like:
That way the helper will be same as it was created. |
but in main state,how can i get this sipuaHelper? |
@pogenz45 , you don't need the helper in main isolate. You should handle everything related to helper in background isolate and send the necessary data to main isolate to update the UI |
Do you have gmail or any contract method? |
|
But how can you h
I sent a mail |
Hello, have you found a solution for this issue? I am experiencing the same problem in the background. When you find a solution, can you share it with me? |
I’m having the same issue. When I answer with the app closed, the audio works, but it doesn’t open the call screen… has anyone managed to solve this problem? |
I'm experiencing the same issue: the VoIP call runs, but the app can't capture the 'call' object from SIP UA, and it doesn't navigate to the call screen when initiated by CallKit. Has anyone managed to solve this? |
You can only capture the call when keep connection onl |
When I receive a notification from FCM, I register with the SIP server (Asterisk). Shortly after, I receive a call invite via SIP UA and trigger the callkit incoming notification, all while in the background. When the user accepts the call by clicking "Accept" on the callkit, my app is launched, and the call is answered using call.answer from SIP UA. I check on the native Android side if the app was initialized by the callkit library and navigate to my call screen. The call and audio traffic work, but I don't have access to the SIP UA call object that initiated the call. It seems as though the SIP call is happening in a different "thread" while the app is running on another with a new instance of the SIP UA helper. When I retrieve the call.id and try to find the call with findCall(), it returns null. However, the call is ongoing since I can hear and respond to the audio. |
gmail [email protected] to know more of this problem bro |
show code you handle accept button of callkit |
I would be very happy if you share your solution with me. |
I'm sending a zip file with the main files of the app. If there are any further details needed, we can communicate via email, but I believe it's important to have this discussion here to help others who might face the same issue. Here’s the code for the callkit answer button: import 'package:flutter_callkit_incoming/entities/entities.dart'; void displayIncomingCall(String callUUID, String handle) async { await FlutterCallkitIncoming.showCallkitIncoming(params); void handleIncomingSipCall(Call call) { String? callUUID = call.id; displayIncomingCall(callUUID!, call.remote_display_name!); FlutterCallkitIncoming.onEvent.listen((event) async {
}); |
I really have the same problem. I believe it’s a simple issue to resolve. It would be useful to document this solution. |
the problem is if you handle reconnect sip in function onbackground message of firebase |
Hello, in the example you sent, when the first call comes, it establishes the voice connection that you answer, but the call greeting screen closes and the voice continues, and also when I add callkit, when a call comes, the callkit notification is instantly shown multiple times, how can I show this only once? |
in event accept_call of flutter_incomingcall, why don't you set navigator to call_screen and handle call.answer in that screen? |
and problem multitime, just showcomingcall in stateCallEnum.CALL_INITIATION |
Here’s an example of how to use Callkit with FCM, Sipua, and WebRTC on Android. As explained in the FCM documentation, when using the onBackground method in Android, it creates a separate isolate from the main app's isolate. So, when I receive a call notification in the background, I authenticate the Sipua helper in the FCM isolate. Once the main isolate starts, I exchange information between the isolates to manage the Sipua Call and the app interface. If the notification is received while the app is in the foreground, the Sipua registration happens in the same main isolate without needing to exchange information between isolates. For iOS, according to the FCM documentation, a separate isolate is not created for onBackground, so it works normally. You only need to obtain the token to receive the PushVoIP notification on iOS. |
nice work, Thank you |
I have a phone app and I implemented calls using flutter_webrtc and sip_ua it works fine in foreground mode but when the app is killed I used flutter_callkit_incoming to show call notification, upon call accept I'll be able to pick the call but can't navigate to call screen because when the app starts from killed state it does not have Call data which is required to pass to callscreen.
The text was updated successfully, but these errors were encountered: