hiennguyen92 / flutter_callkit_incoming

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

Duplicate missed call notifications #533

Open paramaw opened 6 months ago

paramaw commented 6 months ago

When a miss call happens, it shows duplicate notifications.

You can see this in the existing example app.

However, if I comment out the avatar field, it works fine.

Here's the exact location of the file

  Future<void> makeFakeCallInComing() async {
    await Future.delayed(const Duration(seconds: 1), () async {
      _currentUuid = _uuid.v4();

      final params = CallKitParams(
        id: _currentUuid,
        nameCaller: 'Hien Nguyen',
        appName: 'Callkit',
        // avatar: 'https://i.pravatar.cc/100', -- if this is commented out, no bug occurs.
        handle: '0123456789',
        type: 0,
        duration: 30000,
        ...
        ),
      );
      await FlutterCallkitIncoming.showCallkitIncoming(params);
    });
  }
tgh1701 commented 6 months ago

Same issue

deepakSoftRadixNew commented 6 months ago

Same issue

sunil-singh-chaudhary commented 4 months ago

did you find any solution when call is missed getting duplicate notification help pls

sunil-singh-chaudhary commented 4 months ago

hi ,

this is my code

class CallUtils { static Future showIncomingCall(var body) async { Uuid uuid = const Uuid(); String currentUuid = uuid.v4();

String defaultImage = 'https://i.pravatar.cc/500';
String? profilePic = body['profile'];

String imageUrl;
if (profilePic != null) {
  imageUrl = imgBaseurl + profilePic;
} else {
  imageUrl = defaultImage;
}
bool calltype = body['call_type'] == 10; //video call or audio call

log('calltype is  $calltype');

CallKitParams callKitParams = CallKitParams(
  id: currentUuid,
  nameCaller: body['name'] ?? 'User',
  appName: 'appname',
  handle: 'appname Partner',
  // avatar: imageUrl,
  type: calltype ? 1 : 0, 
  textAccept: 'Accept',
  textDecline: 'Decline',
  duration: 30000,
  missedCallNotification: const NotificationParams(
    showNotification: true,
    isShowCallback: true,
    subtitle: 'Missed call',
    callbackText: 'Call back',
  ),
  extra: <String, dynamic>{
    'call_type': body['call_type'],
    'notificationType': body['notificationType'],
    'callId': body['callId'],
    'profile': body['profile'],
    'name': body['name'],
    'id': body['id'],
    'fcmToken': body['fcmToken'],
    'call_duration': body['call_duration'].toString(),
  },

  headers: <String, dynamic>{'apiKey': 'sunil@123!', 'platform': 'flutter'},
  android: const AndroidParams(
    isCustomNotification: true,
    isShowLogo: true,
    ringtonePath: 'system_ringtone_default',
    backgroundColor: '#0955fa',
    actionColor: '#4CAF50',
    textColor: '#ffffff',
    incomingCallNotificationChannelName: "Incoming Call",
    isShowCallID: true,
  ),
);

await FlutterCallkitIncoming.showCallkitIncoming(callKitParams);

} } if i add this line avatar: imageUrl, then duplicate notification is showing when call is missed but when i removed this avatar field then i am getting one notification which is correct i think the culprit here is avatar , anybody have any idea how to resolve this i want to show avatar too how can i do this

itsdani121 commented 3 months ago

@sunil-singh-chaudhary are you found any solution ? i am also ffaciing this issue. also custom notification didinot get name and body of text in android but when it false then it works fine.

sunil-singh-chaudhary commented 3 months ago

no nothing yet

@sunil-singh-chaudhary are you found any solution ? i am also ffaciing this issue. also custom notification didinot get name and body of text in android but when it false then it works fine.

kevin4dhd commented 1 month ago

Same problem, any solution?

deepaksuthar23086 commented 1 month ago

some problem, but something changed. The first notification showed the user avatar (user profile), but the second notification not show the avatar.

any solution?