Skip to main content

qbox_call_sdk 0.2.0 copy "qbox_call_sdk: ^0.2.0" to clipboard
qbox_call_sdk: ^0.2.0 copied to clipboard

Headless Flutter SDK for QBox contact-center calls: video, audio and text chat with an operator. You build the UI; the SDK handles signaling, WebRTC, chat and background calls.

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://qbox.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://qbox.example.com',
    origin: 'https://qbox.example.com',
    sessionToken: () => backend.createQBoxSession(),
    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 #

  • Developer guide (Russian): GUIDE.md.
  • Full reference UI: the example app.
2
likes
0
points
202
downloads

Publisher

unverified uploader

Weekly Downloads

Headless Flutter SDK for QBox contact-center calls: video, audio and text chat with an operator. You build the UI; the SDK handles signaling, WebRTC, chat and background calls.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, flutter_webrtc, http, meta, pointycastle, socket_io_client

More

Packages that depend on qbox_call_sdk

Packages that implement qbox_call_sdk