Skip to main content

Requirements

PlatformMinimum version
iOSDeployment target >= 12.0 (14.0 for screen sharing)
AndroidminSdkVersion >= 24
React Native>= 0.60 (autolinking required)

Install packages

Install react-native-daily-js and its peer dependencies:
npm i @daily-co/react-native-daily-js \
  @react-native-async-storage/async-storage@^1.15.7 \
  react-native-background-timer@^2.3.1 \
  react-native-get-random-values@^1.9.0
npm i --save-exact @daily-co/react-native-webrtc@124.0.6-daily.1
@daily-co/react-native-webrtc must be installed with --save-exact. Using a version range can cause native build failures.

Expo projects

If your project uses Expo, use the @daily-co/config-plugin-rn-daily-js package to automatically configure the native project. This handles all of the iOS and Android steps below. Add the plugin to your app.json:
{
  "expo": {
    "plugins": [
      [
        "@daily-co/config-plugin-rn-daily-js",
        {
          "enableCamera": true,
          "enableMicrophone": true,
          "enableScreenShare": true
        }
      ]
    ]
  }
}
Then generate your native project:
npx expo prebuild
This project cannot be used with Expo Go because it requires custom native code. Use a development build instead.

Bare React Native projects

iOS

Update the platform in your Podfile:
platform :ios, '12.0'
Then install pods:
npx pod-install
Next, add the following keys to your Info.plist. The app will crash silently without the camera and microphone entries.
<key>NSCameraUsageDescription</key>
<string>Your app needs camera access for video calls</string>
<key>NSMicrophoneUsageDescription</key>
<string>Your app needs microphone access for audio calls</string>
<key>UIBackgroundModes</key>
<array>
    <string>voip</string>
</array>
UIBackgroundModes: voip ensures audio continues uninterrupted when your app is backgrounded.

Android

Add permissions and the foreground service to your AndroidManifest.xml:
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus"/>

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_CAMERA"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION"/>
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>

<application>
  <!-- ... -->
  <service
    android:name="com.daily.reactlibrary.DailyOngoingMeetingForegroundService"
    android:foregroundServiceType="camera|microphone"/>
</application>
FOREGROUND_SERVICE_MEDIA_PROJECTION is only required if you intend to support screen sharing.
Update minSdkVersion in your top-level build.gradle:
minSdkVersion = 24

Screen sharing

Screen sharing requires additional setup on both platforms. iOS: Screen sharing requires iOS 14.0 or later (update your Podfile platform accordingly). Additional setup is needed to integrate Daily’s React Native Screen Share Extension. See that repo’s README for a full walkthrough. Android: No additional steps beyond adding FOREGROUND_SERVICE_MEDIA_PROJECTION to your AndroidManifest.xml as shown above.

Verify installation

Once installed, join a call to confirm everything is working:
import Daily from '@daily-co/react-native-daily-js';

const call = Daily.createCallObject();
await call.join({ url: 'https://your-domain.daily.co/room-name' });