Skip to content

Commit 7fa66b5

Browse files
authored
Update README.md (#116)
* Update README.md Update README.md code blocks style and adding Kotlin library setup example. * Update README.md code style adding xml
1 parent ba927b8 commit 7fa66b5

1 file changed

Lines changed: 24 additions & 5 deletions

File tree

README.md

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ Once the `@livekit/react-native-webrtc` dependency is installed, one last step i
3737

3838
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:
3939

40-
```
40+
#### Java
41+
```java
4142
import com.livekit.reactnative.LiveKitReactNative;
4243
import com.livekit.reactnative.audio.AudioType;
4344

@@ -55,11 +56,30 @@ public class MainApplication extends Application implements ReactApplication {
5556
}
5657
```
5758

59+
Or in your **MainApplication.kt** if you are using RN 0.73+
60+
#### Kotlin
61+
```kt
62+
import com.livekit.reactnative.LiveKitReactNative
63+
import com.livekit.reactnative.audio.AudioType
64+
65+
class MainActivity : ReactActivity() {
66+
override fun onCreate(savedInstanceState: Bundle?) {
67+
// Place this above any other RN related initialization
68+
// When AudioType is omitted, it'll default to CommunicationAudioType
69+
// use MediaAudioType if user is only consuming audio, and not publishing
70+
LiveKitReactNative.setup(this, AudioType.CommunicationAudioType())
71+
72+
//...
73+
}
74+
}
75+
```
76+
----
77+
5878
### iOS
5979

6080
In your [AppDelegate.m](https://github.com/livekit/client-sdk-react-native/blob/main/example/ios/LivekitReactNativeExample/AppDelegate.mm) file:
6181

62-
```
82+
```objc
6383
#import "LivekitReactNative.h"
6484

6585
@implementation AppDelegate
@@ -207,9 +227,8 @@ Android screenshare requires a foreground service with type `mediaProjection` to
207227
The example app uses [@voximplant/react-native-foreground-service](https://github.com/voximplant/react-native-foreground-service) for this.
208228
Ensure that the service is labelled a `mediaProjection` service like so:
209229
210-
```
211-
<service android:name="com.voximplant.foregroundservice.VIForegroundService"
212-
android:foregroundServiceType="mediaProjection" />
230+
```xml
231+
<service android:name="com.voximplant.foregroundservice.VIForegroundService" android:foregroundServiceType="mediaProjection" />
213232
```
214233
215234
Once setup, start the foreground service prior to using screenshare.

0 commit comments

Comments
 (0)