FLUTTER

Flutter voice & video call SDK

Add chat, 1:1 and group voice and video calls, and screen sharing to Flutter apps. Calls keep working in the background with an ongoing-call notification. Published on pub.dev as rtcexpress. Android is supported; iOS is experimental and not yet verified on devices.

Before you start

Authenticate the user in your own backend, decide whether they may enter the room, and request a short-lived RTC token. The client receives that token and never receives the App Secret.

Install

Install the rtcexpress plugin from pub.dev, or follow the Flutter voice calling tutorial to build a working call app step by step. There are also tutorials for video calling and in-app chat.

flutter pub add rtcexpress

Initialize and join a room

final rtc = RTCExpress();

await rtc.init(RTCInitOptions(
  serverUrl: serverUrl,
  appId: appId,
  userId: userId,
  token: token, // issued by your backend
));
await rtc.joinRoom("room-1");

Calling people in your app

A call happens inside a room: the caller must have joined it, and on Starter and Pro the person being called must be a member too. For an app where users call their contacts:

  1. Your backend gives each signed-in user one token without a roomId.
  2. After init, join one room per contact, named from both user IDs in sorted order, for example dm_alice__bob. Join them one at a time and wait for roomJoined each time.
  3. To call Bob, join dm_alice__bob again (it becomes the current room), wait for roomJoined, then call.
  4. The incoming call says whether it is voice or video (callType): ask for camera permission only for video.
Don't scope a token to one contact's roomThe user could then be called only by that one person. Rooms named dm_<userA>__<userB> are private: only those two users can join them, so chat history and calls stay between the pair. For a single fixed room (a support chat, one meeting) create the token with that roomId instead.

Screen sharing

Version 0.1.2 or later, on Android. Share the phone’s screen in a call; Android asks the user first.

await rtc.startScreenShare();
await rtc.stopScreenShare();
rtc.on('screenShare', (p) { /* {userId, active, local} */ });
rtc.on('remoteMediaState', (p) { /* {userId, audioMuted, videoOff}: show muted / camera off (0.1.4) */ });
rtc.on('peerReconnecting', (p) { /* {userId, reconnecting}: show "Reconnecting…" after a network drop (0.1.6) */ });

RTCVideoView(screen: true, userId: sharerId)   // the shared screen, big
RTCVideoView(local: true)                       // your camera, small

Needs a plan with screen sharing (Pro) and calls through the media server (mediaMode: 'auto', the default). Android shows its own “Start recording or casting?” prompt first. Web users see a phone’s shared screen, and phones see a browser’s.

Calls in the background

Calls keep working when the user goes to another app or turns the screen off. During a call the SDK shows an “Ongoing call” notification with a timer: tap it to return to the app, or press Hang up. Android needs this notification for an app to keep using the microphone and camera in the background. It is on by default. Turn it off with RTCInitOptions(..., ongoingCallNotification: false) if your app shows its own.

Publishing on Google Play (target Android 14 or newer): the SDK declares foreground services of type microphone, camera and mediaProjection, so fill in the “Foreground service permissions” form in Play Console (reasons: ongoing voice/video call, and screen sharing during a call).

Production notes

Keep authorization on your serverNever use fetchToken with an App Secret in a shipped Flutter app. Call your own backend for the token.

Test two real devices, permission denial, network switching, background behavior, and reconnects. Record the call ID and UTC time for diagnostics.