hiennguyen92 / flutter_callkit_incoming

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

Android notification is clipped even in the latest version (2.0.4) #547

Open ismaeldinacode opened 5 months ago

ismaeldinacode commented 5 months ago

Hi, I’m facing an issue that has been mentioned in the past, related to notifications on some Android devices. The CallKit notification appears as shown in the image below:

imagen Xiaomi POCO F3 with HyperOS (Android 14)

Even though I set the parameter isCustomSmallExNotification to true, the problem persists. My code for creating the CallKit notification is as follows:

Future<void> showCallkitIncoming(Notification? notification) async {
    var androidParams = const AndroidParams(
      isCustomNotification: true,
      isCustomSmallExNotification: true,
      isShowLogo: false,
      isShowCallID: false,
      isShowFullLockedScreen: true,
      ringtonePath: 'system_ringtone_default',
      backgroundColor: '#0955fa',
      backgroundUrl: 'assets/test.png',
      actionColor: '#4CAF50',
    );

    var iOSParams = const IOSParams(
      iconName: 'CallKitLogo',
      handleType: '',
      supportsVideo: true,
      maximumCallGroups: 2,
      maximumCallsPerCallGroup: 1,
      audioSessionMode: 'default',
      audioSessionActive: true,
      audioSessionPreferredSampleRate: 44100.0,
      audioSessionPreferredIOBufferDuration: 0.005,
      supportsDTMF: true,
      supportsHolding: true,
      supportsGrouping: false,
      supportsUngrouping: false,
      ringtonePath: 'system_ringtone_default',
    );

    final params = CallKitParams(
      id: const Uuid().v4(),
      nameCaller: notification?.homeTag ?? 'Home',
      appName: 'MeetMe',
      avatar: '',
      handle: '',
      type: 0,
      duration: 30000,
      textAccept: 'Accept',
      textDecline: 'Decline',
      extra: <String, dynamic>{
        'callId': notification?.callId,
        'channelId': notification?.channelId,
        'type': notification?.type,
        'userLicense': notification?.userLicense,
        'background': notification?.isInBackground,
        'callAs': notification?.callAs
      },
      headers: <String, dynamic>{'apiKey': 'Abc@123!', 'platform': 'flutter'},
      android: androidParams,
      ios: iOSParams,
      missedCallNotification: const NotificationParams(
        showNotification: false,
        isShowCallback: true,
        subtitle: 'Missed call',
        callbackText: 'Call back',
      ),
    );
    await FlutterCallkitIncoming.showCallkitIncoming(params);
  }

Am I missing something, or is this still a problem even in the newer versions of the plugin?