flutter_demos icon indicating copy to clipboard operation
flutter_demos copied to clipboard

Problem with calls after hot restart

Open AsemAmmar99 opened this issue 2 years ago • 13 comments

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.

AsemAmmar99 avatar Dec 11 '22 08:12 AsemAmmar99

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?

YuliaGrigorieva avatar Dec 12 '22 10:12 YuliaGrigorieva

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 )

AsemAmmar99 avatar Dec 12 '22 10:12 AsemAmmar99

"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:

  1. app is in the background
  2. app receives an incoming call (call 1)
  3. app receives an incoming call (call 2)
  4. user tries to answer both calls

is it a correct scenario? Sorry, I have a misunderstanding about the case

YuliaGrigorieva avatar Dec 12 '22 10:12 YuliaGrigorieva

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

AsemAmmar99 avatar Dec 12 '22 10:12 AsemAmmar99

My Logs Screen Shot 2022-12-12 at 12 49 23 PM

AsemAmmar99 avatar Dec 12 '22 10:12 AsemAmmar99

Any updates or help ????!!!!

AsemAmmar99 avatar Dec 15 '22 10:12 AsemAmmar99

Is there any solution to my problem ?!!!!!!!!!!!!!!

AsemAmmar99 avatar Dec 18 '22 07:12 AsemAmmar99

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:

  1. 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
  2. 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.
  3. 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:

  1. do you run hot restart before the call2 is answered?
  2. 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

YuliaGrigorieva avatar Dec 19 '22 18:12 YuliaGrigorieva

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.

AsemAmmar99 avatar Dec 20 '22 07:12 AsemAmmar99

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.

AsemAmmar99 avatar Dec 20 '22 07:12 AsemAmmar99

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

YuliaGrigorieva avatar Dec 20 '22 12:12 YuliaGrigorieva

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 ?!

AsemAmmar99 avatar Dec 21 '22 07:12 AsemAmmar99

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

YuliaGrigorieva avatar Dec 21 '22 17:12 YuliaGrigorieva