hiennguyen92 / flutter_callkit_incoming

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

[Android] - Unable to hide incoming call notification/vibration stays on #546

Open kamilkarp opened 5 months ago

kamilkarp commented 5 months ago

Either hiding incoming notification doesnt work or Im doing something wrong.

Reproducing in examle:

Im looping for all notification to make sure all of them will hide

  Future<void> hideIncoming() async {
    final allCalls =
        await FlutterCallkitIncoming.activeCalls() as List<dynamic>;

    for (final call in allCalls) {
      final id = call['id'] as String?;

      if (id == null) {
        continue;
      }

      final callKitParams = CallKitParams(id: id);

      try {
        await FlutterCallkitIncoming.hideCallkitIncoming(callKitParams);
        // await FlutterCallkitIncoming.endCall(id);
      } catch (e) {
        print('Error: $e');
      }
    }
  }

Doesnt work with or without .endCall.

Now, click make fake incoming call, notification is shown and click hideIncoming button. Hiding this notification works only for the first time. Next incoming calls wont be hidden. Next time, only ringing sound is stopped, but the vibration and notification stays on. Only restart of the app helps.

kamilkarp commented 5 months ago

@hiennguyen92