Skip to content

Daakia-Org/daakia_callkit_flutter

Repository files navigation

Daakia logo

daakia_callkit_flutter

daakia_callkit_flutter helps Flutter apps integrate Daakia-backed incoming call signaling for Android and iOS.

It covers:

  • device token registration with the Daakia backend
  • incoming call push handling
  • Android full-screen incoming call notifications
  • iOS VoIP / CallKit bridge
  • a default incoming call screen
  • optional Firestore-based call state sync (experimental)

It does not cover:

  • authentication
  • backend implementation
  • call media / RTC itself
  • app-specific navigation or user management

What You Need

Required:

  • Daakia backend baseUrl
  • Daakia backend secret
  • Firebase project configured for your app
  • Android package name
  • iOS bundle identifier

Optional:

  • Firestore for experimental realtime call status sync
  • daakia_vc_flutter_sdk if you also want Daakia's call joining SDK

Obtaining SDK Access

To use daakia_callkit_flutter, you need Daakia-issued backend access for your project.

This typically includes:

  • Daakia backend baseUrl
  • Daakia backend secret
  • SDK usage authorization or valid license access

How to get access:

Our team will guide you through onboarding, collect the required client setup details, complete the backend-side configuration, and provide the credentials needed to use the SDK.

Quick Start

Add the package:

dependencies:
  daakia_callkit_flutter: ^1.1.1

Initialize the SDK:

final sdk = DaakiaCallkitFlutter(
  config: const DaakiaCallkitConfig(
    baseUrl: 'https://your-daakia-base-url',
    secret: 'your-shared-secret',
  ),
);

await sdk.initialize(
  onIncomingCall: (payload) async {
    // Open your call UI.
  },
  onCallEvent: (event) async {
    switch (event.type) {
      case DaakiaCallEventType.accepted:
      case DaakiaCallEventType.declined:
      case DaakiaCallEventType.ended:
      case DaakiaCallEventType.timedOut:
      case DaakiaCallEventType.incoming:
      case DaakiaCallEventType.unknown:
        break;
    }
  },
);

Initialize it during app startup, not only after opening a settings or test screen. If you support changing baseUrl or secret for QA, persist the last working values and bootstrap with them on the next launch so closed-state accept actions can still reach your call flow.

Register the current device:

await sdk.registerCurrentDevice(
  username: 'current_user_id',
  token: 'fcm_or_apns_token',
  voipToken: 'optional_ios_voip_token',
  platform: DaakiaPlatform.android, // or DaakiaPlatform.ios
);

Trigger an incoming call:

await sdk.startCallByUsername(
  username: 'target_user_id',
  title: 'Caller Name',
  message: 'Incoming call',
  data: {
    'type': 'incoming_call',
    'callId': 'meeting_uid_123',
    'sender': '{"uid":"current_user_id","userName":"Caller Name"}',
    'callerId': 'current_user_id',
    'receiverId': 'target_user_id',
  },
);

Integration Order

  1. Complete Firebase setup.
  2. Complete Android or iOS platform setup.
  3. Initialize the SDK.
  4. Register the current device token.
  5. Handle incoming call events.
  6. Optionally add Firestore-based call state sync.
  7. Optionally integrate your call media SDK.

Documentation

Start here:

Platform setup:

SDK usage:

Important Notes

  • Android always uses config_name: prod.
  • iOS sandbox uses config_name: dev.
  • iOS production uses config_name: prod.
  • Firestore support is optional and currently experimental.
  • Android background call delivery still requires a top-level FirebaseMessaging.onBackgroundMessage(...) handler in the host app.
  • Real iOS VoIP / CallKit validation still requires a signed physical device.

Example App

See the example flow in example/lib/main.dart.

The example shows:

  • startup SDK initialization from the last saved config
  • Android background FCM handling
  • startup VoIP initialization on iOS
  • token registration
  • trigger by username or token
  • optional Firestore adapter usage
  • opening the provided incoming call screen

Optional Call SDK

This package handles signaling and incoming-call orchestration. Joining the actual call is app-defined.

If you want to use Daakia's call SDK as well, see:

For support, email contact@daakia.co.in.

About

Call kit SDK for Flutter

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors