REACT NATIVE

React Native voice & video call SDK

Add chat, 1:1 and group voice and video calls, and screen sharing to React Native apps, with ready-made call screens you can drop in. Calls keep working in the background with an ongoing-call notification. Published on npm as rtcexpress-react-native. 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-react-native package from npm, or follow the React Native voice calling tutorial to build a working call app step by step. There are also tutorials for video calling and in-app chat.

npm install rtcexpress-react-native

Initialize and join a room

import RTCExpress from "rtcexpress-react-native";

const rtc = new RTCExpress();
await rtc.init({ serverUrl, appId, userId, token, mediaMode: "auto" });
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.

Group voice and video calls

Version 0.1.1 or later, on Android. After joining a room, join its group call, show one video tile per person and highlight who is speaking. Group voice needs the Starter plan; group video needs Pro.

rtc.joinVideoRoom(); // or rtc.joinVoiceRoom()
rtc.on("mediaParticipant", ({ userId, joined }) => updateTiles(userId, joined));
rtc.on("audioLevels", (levels) => setSpeaking(levels)); // { alice: 0.8, bob: 0.1 }

<RTCVideoView userId="bob" style={{ flex: 1 }} /> // one tile per person
rtc.leaveVideoRoom();

Ready-made call screens

Version 0.1.2 or later. Use the built-in call screens instead of designing your own: incoming call with Answer and Decline, “Ringing…”, the in-call screen with timer, Mute, Camera, Flip, Share screen and End, and a short “Call ended”, “Declined” or “Call failed” message with the reason. Microphone and camera permission is asked for you.

import RTCExpress, { useRTCCall, CallScreen, OngoingCallBar } from "rtcexpress-react-native";

const call = useRTCCall(rtc);

<View style={{ flex: 1 }}>
  <OngoingCallBar call={call} />      {/* "Bob · 1:23 · Tap to return" while minimized */}
  <YourNavigation />
  <Button title="Call Bob" onPress={() => call.startCall("bob")} />  {/* { video: true } for video */}
  <CallScreen controller={call} />    {/* last: covers the app during a call */}
</View>

The Android back button (or the ⌄ arrow) minimizes the call so people can use the rest of your app; the green bar brings them back. Group calls work the same way with useRTCGroupCall(rtc, myUserId) and <GroupCallScreen controller={group} userId={myUserId} /> (tiles for each person, a frame around whoever speaks). Change colours and text with theme and labels, and names with displayName.

Screen sharing

The call screens above already include a Share button. When someone shares, their screen shows big and the cameras small. Without the UI kit:

rtc.startScreenShare();   // Android asks the user first
rtc.stopScreenShare();
rtc.on("screenShare", ({ userId, active, local }) => {});
rtc.on("remoteMediaState", ({ userId, audioMuted, videoOff }) => {}); // show muted / camera off (0.1.4)
rtc.on("peerReconnecting", ({ userId, reconnecting }) => {}); // "Reconnecting…" after a network drop (0.1.6)

<RTCVideoView screen userId={sharerId} style={{ flex: 1 }} />   // the shared screen, big
<RTCVideoView local style={{ width: 96, height: 128 }} />       // 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 ongoingCallNotification: false in rtc.init() 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 serverConfigure native microphone and camera permissions. Keep the App Secret on your backend; do not embed it in JavaScript.

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