How CallKeep manages the call lifecycle
masterCallKeep bridges the gap between your app's internal call logic (RTC/VoIP) and the native OS calling interfaces (CallKit on iOS, ConnectionService on Android).
The Workflow:
- Trigger: An external signal (like an FCM push) arrives.
- Setup:
callKeep.setup()is called to initialize native services. - Display:
callKeep.displayIncomingCall()is invoked to show the native incoming call UI. - User Action: The user interacts with the native UI (e.g., taps 'Answer').
- Event: CallKeep emits an event (e.g.,
CallKeepPerformAnswerCallAction) to your Flutter code. - App Logic: Your app receives the event and initiates the actual media connection (WebRTC, etc.).
- Control: When your app needs to end the call, it calls
callKeep.endCall(uuid)to sync the native UI state.