hiennguyen92 / flutter_callkit_incoming

Flutter Callkit Incoming
https://pub.dev/packages/flutter_callkit_incoming
MIT License
170 stars 285 forks source link

CallKit window does not hide, when accept call from app (IOS) #304

Open GAG888 opened 1 year ago

GAG888 commented 1 year ago

Hello! CallKit window (alert) not hiding, when accept call in app and call await FlutterCallkitIncoming.setCallConnected(callId);

GAG888 commented 1 year ago

For example, in connectycube_flutter_call_kit calling this method hiding window with CallKit: await ConnectycubeFlutterCallKit.clearCallData(sessionId: sessionId); await ConnectycubeFlutterCallKit.reportCallAccepted(sessionId: sessionId);

GAG888 commented 1 year ago

I have zero knowledge of flutter and swift, nevertheless it seems to me that this is a bug in the library. I solved my problem by adding the following code to the AppDelegate and calling it at the right time. But I think, this is a very bad decision. I think, library need to change the setCallConnected method.

      let answerAction: CXAnswerCallAction = CXAnswerCallAction(call: incomingCallUUID)
      let transaction: CXTransaction = CXTransaction(action: answerAction)
      let callController : CXCallController
      callController = CXCallController()

P.S. Thanks for the quick response

GAG888 commented 1 year ago

nevertheless, I consider your library the best at the moment, Thank you!

hiennguyen92 commented 1 year ago

once answerAction is called, it will go here https://github.com/hiennguyen92/flutter_callkit_incoming/blob/f1be4c84353ec2dfe1d120ed66d3a59633d1ea8c/ios/Classes/SwiftFlutterCallkitIncomingPlugin.swift#L463

thanks for your suggestion, i will research and update it.

zarubto4 commented 1 year ago

Hi @hiennguyen92, its possible to somehow work around it and solve it differently, just some advice. Because not it's not possible to accept call when iOs App running is in the foreground and accepted from Call screen UI.

I'm a bit desperate how to solve this.

hiennguyen92 commented 1 year ago

@zarubto4 Can you provide me a video of the whole process. it will help me reproduce that issue. thanks

aososam commented 1 year ago

@hiennguyen92 here is the requested video: https://drive.google.com/file/d/1Fdv0yfnqOSh1-6iTxDa1mYUoeNKQetul/view?usp=sharing

in this issue, the app is already running. it means the user was actively using the app and he got a call, the app showed the UI to answer and the user answers but the voip notification does not go away since the call was not answered through the notification.

I see there is a method FlutterCallkitIncoming.endCall(this._currentUuid);

so I would expect something similar to FlutterCallkitIncoming.acceptCall(this._currentUuid);

pedromachadinho commented 11 months ago

Hi @aososam , Any updates on this? Facing same issue