From a90f0c0c884329d2d2c6de42c9be8bc1eedb04a8 Mon Sep 17 00:00:00 2001
From: Pratyush Sabharwal <155612188+itz-Me-Pj@users.noreply.github.com>
Date: Wed, 16 Jul 2025 16:18:26 +0000
Subject: [PATCH 1/2] Added Constructor and Updated Ref Syntax for Video View
---
src/TwilioVideo.android.js | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/TwilioVideo.android.js b/src/TwilioVideo.android.js
index 4e40bf49..494062a0 100644
--- a/src/TwilioVideo.android.js
+++ b/src/TwilioVideo.android.js
@@ -170,6 +170,12 @@ const nativeEvents = {
};
class CustomTwilioVideoView extends Component {
+ constructor(props) {
+ super(props);
+ // Use createRef instead of string ref to fix warning
+ this.videoViewRef = React.createRef();
+ }
+
connect({
roomName,
accessToken,
@@ -271,7 +277,7 @@ class CustomTwilioVideoView extends Component {
switch (Platform.OS) {
case "android":
UIManager.dispatchViewManagerCommand(
- findNodeHandle(this.refs.videoView),
+ findNodeHandle(this.videoViewRef.current),
event,
args
);
@@ -320,7 +326,7 @@ class CustomTwilioVideoView extends Component {
render() {
return (
From 0cc6a66dfec9c7713d207f23e9e8a8da6fd3c9cf Mon Sep 17 00:00:00 2001
From: Pratyush Sabharwal <155612188+itz-Me-Pj@users.noreply.github.com>
Date: Wed, 16 Jul 2025 16:48:11 +0000
Subject: [PATCH 2/2] Updated Readme with Required installation steps as per
new react-native arch 0.79+
---
README.md | 25 ++++++++++++++++++++++---
1 file changed, 22 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index a21765e6..559f3066 100644
--- a/README.md
+++ b/README.md
@@ -168,7 +168,7 @@ dependencies {
.....
.....
.....
- implementation project(':react-native-twilio-video-webrtc')
+ implementation(project(':react-native-twilio-video-webrtc'))
}
```
@@ -177,8 +177,8 @@ You will also need to update this file so that you compile with java 8 features:
```
android {
compileOptions {
- sourceCompatibility 1.8
- targetCompatibility 1.8
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
}
}
```
@@ -200,6 +200,25 @@ Then update the `getPackages()` method:
}
```
+If your React Native project uses Kotlin for the `MainApplication`, follow these steps to manually add the `TwilioPackage`.
+
+
+At the top of your `MainApplication.kt` file, add:
+
+```kotlin
+import com.twiliorn.library.TwilioPackage
+```
+Now update the `getPackages()` method by adding:
+```kotlin
+override val reactNativeHost: ReactNativeHost =
+ object : DefaultReactNativeHost(this) {
+ override fun getPackages(): List =
+ PackageList(this).packages.apply {
+ ...
+ add(TwilioPackage())
+ }
+```
+
### Permissions
For most applications, you'll want to add camera and audio permissions to your `AndroidManifest.xml` file: