qbox_call_sdk
Headless Flutter SDK for QBox contact-center calls: video, audio and text chat with an operator. The SDK handles signaling, WebRTC, chat and background calls; your app builds the UI.
Requires Flutter 3.32+, Android API 21+, iOS 13.0+.
Installation
flutter pub add qbox_call_sdk
Android — android/app/src/main/AndroidManifest.xml:
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT"/>
iOS — ios/Runner/Info.plist:
<key>NSCameraUsageDescription</key>
<string>The camera is used for video calls with an operator.</string>
<key>NSMicrophoneUsageDescription</key>
<string>The microphone is used for calls with an operator.</string>
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
</array>
Usage
final qbox = QBoxCall(
config: const QBoxCallConfig(hostName: 'https://example.com'),
);
final call = qbox.createCall(
const CallRequest(media: CallMedia.video, queueCode: 'video_call'),
);
await call.start();
QBoxCallBuilder(
controller: call,
builder: (context, state) => state.phase == CallPhase.active
? QBoxVideoView(controller: call, source: QBoxVideoSource.remote)
: const CircularProgressIndicator(),
);
// When leaving the screen:
call.dispose();
qbox.dispose();
Bridge v2 login
Your backend vouches for the client: it creates a session over mTLS and gets a
one-time session_token; the SDK logs in with it and keeps the visit.
final qbox = QBoxCall(
config: QBoxCallConfig.v2(
hostName: 'https://example.com',
origin: 'https://example.com',
sessionToken: () => backend.createSession(),
visitStore: mySecureVisitStore,
),
);
final restored = (await qbox.restoreCall()).valueOrNull; // chat after a restart
final queues = (await qbox.connect()).valueOrNull ?? [];
final call = qbox.createCall(
CallRequest(media: CallMedia.audio, queueCode: queues.first.code),
);
await call.start();
// On user logout:
await qbox.forget();
Screen sharing
In a video call the client can show the screen instead of the camera:
await call.toggleScreenShare(), state in call.value.isScreenSharing.
Android asks the user and keeps sharing in the background (declare the
mediaProjection foreground service type in Play Console); iOS shares the
app's own screen.
Documentation
Libraries
- qbox_call_sdk
- QBox call SDK — headless audio/video/text calls with QBox operators.