Skip to content

Commit a74c941

Browse files
authored
Add swift installation instructions (#271)
1 parent e420ea5 commit a74c941

File tree

1 file changed

+54
-5
lines changed

1 file changed

+54
-5
lines changed

README.md

Lines changed: 54 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<!--END_BANNER_IMAGE-->
1010

11-
# livekit-react-native
11+
# React Native client SDK for LiveKit
1212

1313
<!--BEGIN_DESCRIPTION-->
1414
Use this SDK to add realtime video, audio and data features to your React Native app. By connecting to <a href="https://livekit.io/">LiveKit</a> Cloud or a self-hosted server, you can quickly build applications such as multi-modal AI, live streaming, or video calls with just a few lines of code.
@@ -43,9 +43,12 @@ Once the `@livekit/react-native-webrtc` dependency is installed, one last step i
4343

4444
### Android
4545

46+
<details>
47+
48+
<summary>Java</summary>
49+
4650
In your [MainApplication.java](https://github.com/livekit/client-sdk-react-native/blob/main/example/android/app/src/main/java/com/example/livekitreactnative/MainApplication.java) file:
4751

48-
#### Java
4952
```java
5053
import com.livekit.reactnative.LiveKitReactNative;
5154
import com.livekit.reactnative.audio.AudioType;
@@ -64,8 +67,14 @@ public class MainApplication extends Application implements ReactApplication {
6467
}
6568
```
6669

67-
Or in your **MainApplication.kt** if you are using RN 0.73+
68-
#### Kotlin
70+
</details>
71+
72+
<details>
73+
74+
<summary>Kotlin</summary>
75+
76+
In your **MainApplication.kt** file:
77+
6978
```kotlin
7079
import com.livekit.reactnative.LiveKitReactNative
7180
import com.livekit.reactnative.audio.AudioType
@@ -81,10 +90,15 @@ class MainApplication : Application, ReactApplication() {
8190
}
8291
}
8392
```
84-
----
93+
94+
</details>
8595

8696
### iOS
8797

98+
<details>
99+
100+
<summary>Objective-C</summary>
101+
88102
In your [AppDelegate.m](https://github.com/livekit/client-sdk-react-native/blob/main/example/ios/LivekitReactNativeExample/AppDelegate.mm) file:
89103

90104
```objc
@@ -108,6 +122,41 @@ In your [AppDelegate.m](https://github.com/livekit/client-sdk-react-native/blob/
108122
}
109123
```
110124
125+
</details>
126+
127+
<details>
128+
129+
<summary>Swift</summary>
130+
131+
In your **AppDelegate.swift** file:
132+
```swift
133+
import livekit_react_native
134+
import livekit_react_native_webrtc
135+
136+
@main
137+
class AppDelegate: UIResponder, UIApplicationDelegate {
138+
func application(
139+
_ application: UIApplication,
140+
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
141+
) -> Bool {
142+
143+
// Place this above any other RN related initialization
144+
LivekitReactNative.setup()
145+
146+
// Uncomment the following lines if you want to use the camera in the background
147+
// Requires voip background mode and iOS 18+.
148+
149+
// let options = WebRTCModuleOptions.sharedInstance()
150+
// options.enableMultitaskingCameraAccess = true
151+
152+
// ...
153+
}
154+
}
155+
156+
```
157+
158+
</details>
159+
111160
### Expo
112161

113162
LiveKit is available on Expo through development builds. You can find our Expo plugin and setup instructions [here](https://github.com/livekit/client-sdk-react-native-expo-plugin).

0 commit comments

Comments
 (0)