hiennguyen92 / flutter_callkit_incoming

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

Plugin didn't respect to the setting of `configureAudioSession` on iOS #601

Open ming-chu opened 4 weeks ago

ming-chu commented 4 weeks ago

The plugin at version 2.0.4+2 didn't respect to the configureAudioSession setting.

After called setCallConnected method it will reset the configureAudioSession to true from Data since it only pass the args {'id': id} for the initialization of Data.

// e.g:
FlutterCallkitIncoming.setCallConnected('xxx-xxx-xxx');

flutter_callkit_incoming.dart#L94-L99

image

SwiftFlutterCallkitIncomingPlugin.swift#L166-L178

image

the self.data.configureAudioSession will be true at line:176 now even we pass the configureAudioSession to false when calling FlutterCallkitIncoming.startCall(params) before.

https://github.com/hiennguyen92/flutter_callkit_incoming/blob/2.0.4%2B2/ios/Classes/Call.swift#L218

image

and then connectedCall method will request the CXAnswerCallAction transaction from the CXCallController which will lead CXProviderDelegate being called in SwiftFlutterCallkitIncomingPlugin.swift.

image

and the delegate method call the configurAudioSession() again with data?.configureAudioSession => true:

image

Am I using the plugin in a wrong way or any suggestion about this issue?

Thanks for your help and providing us this amazing plugin.