> ## Documentation Index
> Fetch the complete documentation index at: https://docs.daily.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Install react-native-daily-js and configure your iOS and Android project.

## Requirements

| Platform     | Minimum version                                     |
| ------------ | --------------------------------------------------- |
| iOS          | Deployment target >= 12.0 (14.0 for screen sharing) |
| Android      | `minSdkVersion` >= 24                               |
| React Native | >= 0.60 (autolinking required)                      |

## Install packages

Install `react-native-daily-js` and its peer dependencies:

```bash theme={null}
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
```

<Note>
  `@daily-co/react-native-webrtc` must be installed with `--save-exact`. Using a version range can cause native build failures.
</Note>

## Expo projects

If your project uses [Expo](https://expo.dev/), use the [`@daily-co/config-plugin-rn-daily-js`](https://www.npmjs.com/package/@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`:

```json theme={null}
{
  "expo": {
    "plugins": [
      [
        "@daily-co/config-plugin-rn-daily-js",
        {
          "enableCamera": true,
          "enableMicrophone": true,
          "enableScreenShare": true
        }
      ]
    ]
  }
}
```

Then generate your native project:

```bash theme={null}
npx expo prebuild
```

<Note>
  This project cannot be used with [Expo Go](https://expo.dev/blog/expo-go-vs-development-builds) because it requires custom native code. Use a [development build](https://docs.expo.dev/develop/development-builds/introduction/) instead.
</Note>

## Bare React Native projects

### iOS

Update the `platform` in your `Podfile`:

```ruby theme={null}
platform :ios, '12.0'
```

Then install pods:

```bash theme={null}
npx pod-install
```

Next, add the following keys to your `Info.plist`. **The app will crash silently without the camera and microphone entries.**

```xml theme={null}
<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`:

```xml theme={null}
<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>
```

<Note>
  `FOREGROUND_SERVICE_MEDIA_PROJECTION` is only required if you intend to support screen sharing.
</Note>

Update `minSdkVersion` in your top-level `build.gradle`:

```groovy theme={null}
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](https://github.com/daily-co/rn-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:

```javascript theme={null}
import Daily from '@daily-co/react-native-daily-js';

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