hiennguyen92 / flutter_callkit_incoming

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

Firebase Cloud Messaging API (V1): Issue with _firebaseMessagingBackgroundHandler Incoming Call Ringtone sound Not Working #477

Open Amshaf123 opened 8 months ago

Amshaf123 commented 8 months ago

Future _firebaseMessagingBackgroundHandler(RemoteMessage message) async { print("Handling a background message: ${message.messageId}"); await Firebase.initializeApp(); //make sure firebase is initialized before using it (showCallkitIncoming) showCallkitIncoming(const Uuid().v4()); }

Future showCallkitIncoming(String uuid) async { final params = CallKitParams( id: uuid, nameCaller: 'Hien Nguyen', appName: 'Callkit', avatar: 'https://i.pravatar.cc/100', handle: '0123456789', type: 0, duration: 30000, textAccept: 'Accept', textDecline: 'Decline', missedCallNotification: const NotificationParams( showNotification: true, isShowCallback: true, subtitle: 'Missed call', callbackText: 'Call back', ), extra: <String, dynamic>{'userId': '1a2b3c4d'}, headers: <String, dynamic>{'apiKey': 'Abc@123!', 'platform': 'flutter'}, android: const AndroidParams( isCustomNotification: true, isShowLogo: false, ringtonePath: 'system_ringtone_default', backgroundColor: '#0955fa', backgroundUrl: 'assets/test.png', actionColor: '#4CAF50', textColor: '#ffffff', ), ios: 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', ), ); await FlutterCallkitIncoming.showCallkitIncoming(params); } // Legacy is working but V1 Ringtone sound Not Working And another interesting news, lagacy will be eliminated on 6/20/2023 WhatsApp Image 2024-03-07 at 6 15 46 PM