flutter_demos
flutter_demos copied to clipboard
Problem with calls after hot restart
Hello, My issue is that all calls failed after a hot restart or after answering 1 call from the background using flutter_callkit_incoming plugin push UI and it doesn't work again till closing and reopening my application.
Hello!
Regarding the issue with hot restart. If you face with MissingPluginException, it may be expected as according to the documentation:
If the package brings platform-specific code (Kotlin/Java for Android, Swift/Objective-C for iOS), that code must be built into your app. Hot reload and hot restart only update the Dart code, so a full restart of the app might be required to avoid errors like MissingPluginException when using the package.
Regarding the issue with flutter_callkit_incoming plugin. Unfortunately, there is no enough information about the issue, so I cannot provide any recommendations. Could you please give some information about what exactly does not work?
When pressing hot restart or answering one call in the background and trying to answer another call without closing and reopening the app the answerCall function tells ( Trying to answer having no active call )
"Trying to answer having no active call" is the exact error? Do you see it in the logs? Could you please add a logs snippet here?
Regarding the case, do I understand correctly that you have 2 simultenious incoming calls at the moment and you try to answer one or both of them? So, step-by-step scenario is:
- app is in the background
- app receives an incoming call (call 1)
- app receives an incoming call (call 2)
- user tries to answer both calls
is it a correct scenario? Sorry, I have a misunderstanding about the case
step-by-step scenario is:
1- app is in the background 2- app receives an incoming call (call 1) 3- user answers it and continue the call normally till the end 4- app receives an incoming call (call 2) 5- user tries to answer it
My Logs
Any updates or help ????!!!!
Is there any solution to my problem ?!!!!!!!!!!!!!!
Hello @AsemAmmar99 ,
According to the screenshot, the issue is caused by missing VICall instance. However I can't reproduce the issue with demo project.
I see 3 possible reasons:
- you have mentioned a hot restart action in the issue description. Hot restart loads code changes into the VM, and restarts the Flutter app, losing the app state. if a hot restart was done after receiving a VICall instance, VICall instance might be reinitiliazed to null and calling any methods getting a call id or anything related to the call may result in this error
- there is an issue with getting a VICall instance for the second call. However the provided information is not enough to understand the root cause.
- if the app is in the background when a second call is received, user might answer the call fast, before the push is processed. In this case the issue should be resolved with the callkit API with pending transactions mechanism.
According to that please answer the following questions:
- do you run hot restart before the call2 is answered?
- is the app in the background when it receives call2 and how fast the call is answered? can you check in the logs that you receive VIClient,onIncomingCall event
Best regards, Yulia Grigorieva
Hi @YuliaGrigorieva
1- No, when there are no calls. 2- The app is in the background when it receives call1 and then answering all calls in the background or foreground is failed till restarting the app. 3- I answer it fast.
4- No, after receiving call1 in the background and answering or declining it, I don't receive VIClient, onIncomingCall event, I only receive the notification.
Hello @AsemAmmar99,
If you don't receive VIClient.onIncomingCall event that's may be the reason, since VICall instance as well as its call id, can only be gotten with this event.
Can you please check VIClient state?
If it is not logged in, you should connect and login to the Voximplant Cloud, when you receive a push notification.
Best regards, Yulia Grigorieva
Hi @YuliaGrigorieva
I connected and logged in to the Voximplant Cloud when I received a push notification, but sadly the problem remains. Any other solution ?!
Hi @AsemAmmar99
I would recommend to collect the logs (all output from the application start including sdk logs with tags VOXSDK
on android and #VI
on iOS) and send them to our support - [email protected]
Without the logs it's difficult to say what's wrong.
Best regards, Yulia Grigorieva