hiennguyen92 / flutter_callkit_incoming

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

Callkit not functioning properly when receiving a call whilst on a call on iOS #528

Open gbfarah opened 6 months ago

gbfarah commented 6 months ago

There are a few issues at play (not all related to flutter_callkit_incoming)

Issue 1 - Exception in flutter_callkit_incoming

To replicate do the following

  1. Receive an normal cellphone call
  2. Receive a call on flutter app and accept . This make flutter call active and cellphone on hold
  3. Swap calls to cellphone
  4. Swap calls back to flutter app

Exception below is encountered Bad state: No element

0 ListBase.firstWhere (dart:collection/list.dart:132)

1 FlutterCallkitIncoming._receiveCallEvent (package:flutter_callkit_incoming/flutter_callkit_incoming.dart:140)

2 _MapStream._handleData (dart:async/stream_pipe.dart:213)

3 _ForwardingStreamSubscription._handleData (dart:async/stream_pipe.dart:153)

............................

We are currently handling the above in global exception handler that catches library exception and prevents app from crashing

Issue 2 - Audio impairment ( this issue may not be related to flutter_incoming callkit but any feedback is appreciated)

Perform the above mentioned call scenario . At step 4 the flutter app should be active and hence it audio channel should be heard through phone speakers and it microphone stream also active.. We are finding that consistently both audio and mic are silent . The only way to address this is to recreate our microphone/audio streams from scratch (without telling callkit)

Now here's the strange thing. Performing the above where instead of a flutter app one uses whatsapp results in the same issue. However it seems that WhatsApp have a workaround that if silence is detect for a few seconds the call is reinitiated....

Any feedback appreciated