hiennguyen92 / flutter_callkit_incoming

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

iOS: Callkit notification doesn't go away when call is accepted by the app (not via the accept button in the Callkit notification) #558

Open cboscolo opened 4 months ago

cboscolo commented 4 months ago

Our iOS app uses flutter_callkit_incoming to handle in incoming webrtc calls.

When the app is in the foreground, and an inbound VoIP notification triggers the Callkit notification, if the call is accepted from within the app and not by pressing the "Accept" button in the Callkit notification, then the Callkit notification doesn't immediately go away. It stays there for N seconds (N being the duration: passed into the showCallkitIncoming).

On Android, this is handled properly when we call:

          FlutterCallkitIncoming.hideCallkitIncoming(CallKitParams(id: callID));

What is the proper way to do this on iOS?

sunilsinghchaudhary00 commented 1 month ago
                                  FlutterCallkitIncoming
                                      .hideCallkitIncoming(CallKitParams(
                                          id: callController
                                              .callList[index].callId
                                              .toString()));
                                  FlutterCallkitIncoming.setCallConnected(
                                      callController.callList[index].callId
                                          .toString());

                                  Future.delayed(
                                          const Duration(milliseconds: 500))
                                      .then((value) async {
                                    await localNotifications.cancelAll();
                                  });