cometchat_calls_sdk 5.0.7
cometchat_calls_sdk: ^5.0.7 copied to clipboard
Integrate voice & video calling into your Flutter app with CometChat's Calls SDK. Create real-time communication for better user engagement.
CometChat Calls SDK for Flutter #
The CometChat Calls SDK enables real-time voice and video calling capabilities in your Flutter application. Built on top of WebRTC, it provides a complete calling solution with built-in UI components and extensive customization options.
Features #
- 1:1 and group voice/video calls
- Built-in calling UI with customizable themes
- Screen sharing
- Call recording
- Active speaker detection
Installation #
Add the dependency to your pubspec.yaml:
dependencies:
cometchat_calls_sdk: ^5.0.3
Then run:
flutter pub get
Web Support #
The SDK supports Flutter web out of the box. During plugin registration it
automatically injects everything it needs — the CometChat Calls JavaScript
SDK, its stylesheet, and the JS bridge — so no changes to your
web/index.html are required. The calling API is identical to mobile.
1. Enable web for your app #
flutter config --enable-web
# If your project has no web/ folder yet:
flutter create . --platforms=web
2. Use the SDK #
Initialize, log in, then join a session and render the widget returned by
joinSession into your widget tree.
import 'package:cometchat_calls_sdk/cometchat_calls_sdk.dart';
// 1. Initialize
final appSettings = (CallAppSettingBuilder()
..appId = '<APP_ID>'
..region = '<REGION>') // 'us', 'eu' or 'in'
.build();
CometChatCalls.init(
appSettings,
onSuccess: (String message) { /* SDK initialized */ },
onError: (CometChatCallsException e) { /* handle error */ },
);
// 2. Log in
CometChatCalls.login(
uid: '<UID>',
authKey: '<AUTH_KEY>',
onSuccess: (User? user) { /* logged in */ },
onError: (CometChatCallsException e) { /* handle error */ },
);
// 3. Join a session and render the returned widget
final sessionSettings = (SessionSettingsBuilder()
.setTitle('My Meeting')
.startAudioMuted(false)
.startVideoPaused(false))
.build();
CometChatCalls.joinSession(
sessionId: '<SESSION_ID>',
sessionSettings: sessionSettings,
onSuccess: (Widget? callWidget) {
// Add callWidget to your widget tree, e.g.:
// body: SizedBox.expand(child: callWidget)
},
onError: (CometChatCallsException e) { /* handle error */ },
);
3. Run it #
flutter run -d chrome # run during development
flutter build web # production build (serve build/web over HTTPS)
Notes & requirements #
- Internet access — the CometChat Calls JS SDK is loaded from a CDN
(
unpkg.com) at runtime, so the page needs network access on first load. - Secure context — browsers only grant camera/microphone access over
HTTPS or on
localhost. Serve your production web build over HTTPS. - Permissions — the browser prompts for camera/mic on the first call; no Flutter permission plugin is required on web.
- Browsers — any modern WebRTC-capable browser (Chromium-based, Firefox, Safari).
Help and Support #
For issues running the project or integrating with our UI Kits, consult our documentation or create a support ticket or seek real-time support via the CometChat Dashboard.