To use this library with Expo we recommend using our config plugin that you can configure like the following example:
{"name":"my app","plugins":[["react-native-twilio-video-webrtc",{"cameraPermission":"Allow $(PRODUCT_NAME) to access your camera","microphonePermission":"Allow $(PRODUCT_NAME) to access your microphone"}]]}
Also you will need to install expo-build-properties package:
npx expo install expo-build-properties
Expo Config Plugin Props
The plugin support the following properties:
cameraPermission: Specifies the text to show when requesting the camera permission to the user.
microphonePermission: Specifies the text to show when requesting the microphone permission to the user.
iOS
Option A: Install with CocoaPods (recommended)
Add this package to your Podfile
pod 'react-native-twilio-video-webrtc', path:'../node_modules/react-native-twilio-video-webrtc'
Note that this will automatically pull in the appropriate version of the underlying TwilioVideo pod.
Install Pods with
pod install
Option B: Install without CocoaPods (manual approach)
Add the Twilio dependency to your Podfile
pod 'TwilioVideo'
Install Pods with
pod install
Add the XCode project to your own XCode project's Libraries directory from
Add libRNTwilioVideoWebRTC.a to your XCode project target's Linked Frameworks and Libraries
Update Build Settings
Find Search Paths and add $(SRCROOT)/../node_modules/react-native-twilio-video-webrtc/ios with recursive to Framework Search Paths and Library Search Paths
Post install
Be sure to increment your iOS Deployment Target to at least iOS 11 through XCode and your Podfile contains
platform :ios, '11.0'
Permissions
To enable camera usage and microphone usage you will need to add the following entries to your Info.plist file:
<key>NSCameraUsageDescription</key>
<string>Your message to user when the camera is accessed for the first time</string>
<key>NSMicrophoneUsageDescription</key>
<string>Your message to user when the microphone is accessed for the first time</string>
Known Issues
TwilioVideo version 1.3.8 (latest) has the following know issues.
Participant disconnect event can take up to 120 seconds to occur. Issue 99
AVPlayer audio content does not mix properly with Room audio. Issue 62
Then add the library to your settings.gradle file:
include ':react-native-twilio-video-webrtc'
project(':react-native-twilio-video-webrtc').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-twilio-video-webrtc/android')
And include the library in your dependencies in android/app/build.gradle:
(if using gradle 4 or lower, replace implementation with compile below)
Newer versions of Android have a different permissions model. You will need to use the PermissionsAndroid
class in react-native in order to request the CAMERA and RECORD_AUDIO permissions.
Additional Tips
Under default settings, the Android build will fail if the total number of symbols exceeds a certain threshold. If you should encounter this issue when adding this library (e.g., if your build fails with com.android.dex.DexIndexOverflowException), you can turn on jumbo mode by editing your app/build.gradle:
android {
...
dexOptions {
jumboMode true
}
}
If you are using proguard (very likely), you will also need to ensure that the symbols needed by
this library are not stripped. To do that, add these two lines to proguard-rules.pro:
-keep class com.twilio.** { *; }
-keep class tvi.webrtc.** { *; }
Install objective-c dependencies: cd ios && pod install
Open the xcworkspace and run the app: open Example.xcworkspace
Migrating from 1.x to 2.x
Make sure your pod dependencies are updated. If you manually specified a pod version, you'll want to update it as follows:
s.dependency 'TwilioVideo', '~> 2.2.0'
Both participants and tracks are uniquely identified by their sid/trackSid field.
The trackId field no longer exists and should be replaced by trackSid. Commensurate with this change,
participant views now expect participantSid and videoTrackSid keys in the trackIdentity prop (instead of
identity and trackId).
Make sure you're listening to participant events via onParticipant{Added/Removed}VideoTrack rather than onParticipant{Enabled/Disabled}Track.
Full License text you must include and attribute in your project: LICENSE.
Compliance Requirement: All users must include the full text of the MIT License, including the copyright notice and permission notice, in any copies or substantial portions of the Software.
Commercial Use: Commercial entities using this software please ensure compliance with the license terms and proper attribution.
Consequences of Violation: Failure to comply with the MIT License constitutes copyright infringement and may result in legal action, including injunctions and monetary damages. Please ensure to respect the open source project.
For any questions regarding licensing or to request additional permissions, please contact the author.
The npm package react-native-twilio-video-webrtc receives a total of 9,535 weekly downloads. As such, react-native-twilio-video-webrtc popularity was classified as popular.
We found that react-native-twilio-video-webrtc demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.It has 0 open source maintainers collaborating on the project.
Package last updated on 02 Oct 2024
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.
Socket researchers found a malicious Maven package impersonating the legitimate ‘XZ for Java’ library, introducing a backdoor for remote code execution.