The plugin manages two types of notifications: missed call notifications (shown when an incoming call times out) and calling notifications (shown while a call is active). Both are configured via NotificationParams.
Pass a missedCallNotification inside CallKitParams when calling showCallkitIncoming. When the call times out, a missed call notification is displayed automatically.You can also show a missed call notification directly using showMissCallNotification:
The callingNotification parameter inside CallKitParams controls the persistent notification shown on Android while a call is in progress (after the call is started or accepted). Configure it alongside your main call parameters:
On iOS, missed call notifications are delivered through UNUserNotificationCenter. Add the delegate methods to your AppDelegate.swift so notifications appear in the foreground and the “Call back” action is handled correctly.
@UIApplicationMain@objc class AppDelegate: FlutterAppDelegate, PKPushRegistryDelegate, CallkitIncomingAppDelegate { override func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { GeneratedPluginRegistrant.register(with: self) // Required for missed call notification in foreground if #available(iOS 10.0, *) { UNUserNotificationCenter.current().delegate = self as UNUserNotificationCenterDelegate } return super.application(application, didFinishLaunchingWithOptions: launchOptions) } // Show notification even when app is in foreground override func userNotificationCenter( _ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void ) { CallkitNotificationManager.shared.userNotificationCenter( center, willPresent: notification, withCompletionHandler: completionHandler ) } // Handle "Call back" tap from missed call notification override func userNotificationCenter( _ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void ) { if response.actionIdentifier == CallkitNotificationManager.CALLBACK_ACTION { let data = response.notification.request.content.userInfo as? [String: Any] SwiftFlutterCallkitIncomingPlugin.sharedInstance?.sendCallbackEvent(data) } completionHandler() }}
Android 13 (API 33) requires explicit permission before posting notifications. Request it before calling showCallkitIncoming:
await FlutterCallkitIncoming.requestNotificationPermission({ 'title': 'Notification permission', 'rationaleMessagePermission': 'Notification permission is required, to show notification.', 'postNotificationMessageRequired': 'Notification permission is required, Please allow notification permission from setting.',});
Alternatively, you can use requestPermission() from the firebase_messaging package which handles this automatically.
Android 14 (API 34) introduced a new USE_FULL_SCREEN_INTENT permission required to show the incoming call UI over the lock screen. Check for the permission and request it if needed:
// Check whether the app can show full-screen intentsbool canShow = await FlutterCallkitIncoming.canUseFullScreenIntent();if (!canShow) { // Opens the system settings page to grant the permission await FlutterCallkitIncoming.requestFullIntentPermission();}
Without full-screen intent permission on Android 14+, incoming calls will not appear over the lock screen. Request this permission as early as possible, ideally in initState or on app launch.
Show incoming call
Configure and display the native incoming call screen.
Call events
Handle the callback event from missed call notifications.