Flutter incoming caller screen UI

541 Views Asked by At

I want to show incoming caller screen UI in my Flutter app.

enter image description here

I used connectycube_flutter_call_kit to show the incoming call UI

https://pub.dev/packages/connectycube_flutter_call_kit

i am able to get call notification

enter image description here

with this ConnectycubeFlutterCallKit.showCallNotification(callEvent);

  void initState() {
    ConnectycubeFlutterCallKit.initEventsHandler();
    super.initState();
  }

  void _call() {
    Uuid uuid = Uuid();
    CallEvent callEvent = CallEvent(
      sessionId: uuid.v4(),
      callType: 1,
      callerId: 1,
      callerName: 'VCA Marina Bay Cities Animal Hospital',
      opponentsIds: {101}.toSet(),
    );
    ConnectycubeFlutterCallKit.instance.init(
        onCallAccepted: _onCallAccepted,
        onCallRejected: _onCallRejected,
        icon: 'app_icon',
        color: '#000000');
    ConnectycubeFlutterCallKit.showCallNotification(callEvent);
  }

  Future<void> _onCallAccepted(CallEvent callEvent) async {
    // the call was accepted
  }

  Future<void> _onCallRejected(CallEvent callEvent) async {
    // the call was rejected
  }

can u help me get the caller UI using this package . i went throw the documentation saying that i need Connectycube Flutter SDK for this. i want only the incoming call UI with custom notification and custom incoming call UI.

Show Incoming call screen by push notification In case you want to display the Incoming call screen automatically by push notification you can do it easily. For it, the caller should send the push notification to all call members. This push notification should contain some required parameters. If you use the Connectycube Flutter SDK, you can do it using the next code:

1

There are 1 best solutions below

2
Valentyn Tereshchenko On

no, the use of the Connectycube Flutter SDK is not mandatory. you can use any lib for sending the push notification, but the payload of this notification should contain all required fields provided in the README

you will get the full-screen notification in case your device is locked and the showing full-screen intents granted by the system for your app (on Android 14 you should request it from the user and the plugin provides API for it)