Skip to content

iOS: BOOL is unsupported error when calling TWVideoModule.connect() #780

@shaondebnath

Description

@shaondebnath

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

While using this library on iOS, I encountered the following error:

Unhandled promise rejection [Error: TWVideoModule.connect(): Error while converting JavaScript argument 2 to Objective C type BOOL. Objective C type BOOL is unsupported.]

Environment:

React Native version: 0.76.5
iOS Deployment Target: 15.0

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-twilio-video-webrtc/ios/RCTTWVideoModule.m b/node_modules/react-native-twilio-video-webrtc/ios/RCTTWVideoModule.m
index 2311f6c..edef087 100644
--- a/node_modules/react-native-twilio-video-webrtc/ios/RCTTWVideoModule.m
+++ b/node_modules/react-native-twilio-video-webrtc/ios/RCTTWVideoModule.m
@@ -421,7 +421,7 @@ RCT_EXPORT_METHOD(getStats) {
   }
 }
 
-RCT_EXPORT_METHOD(connect:(NSString *)accessToken roomName:(NSString *)roomName enableAudio:(BOOL *)enableAudio enableVideo:(BOOL *)enableVideo encodingParameters:(NSDictionary *)encodingParameters enableNetworkQualityReporting:(BOOL *)enableNetworkQualityReporting dominantSpeakerEnabled:(BOOL *)dominantSpeakerEnabled cameraType:(NSString *)cameraType) {
+RCT_EXPORT_METHOD(connect:(NSString *)accessToken roomName:(NSString *)roomName enableAudio:(BOOL)enableAudio enableVideo:(BOOL)enableVideo encodingParameters:(NSDictionary *)encodingParameters enableNetworkQualityReporting:(BOOL)enableNetworkQualityReporting dominantSpeakerEnabled:(BOOL)dominantSpeakerEnabled cameraType:(NSString *)cameraType) {
   [self _setLocalVideoEnabled:enableVideo cameraType:cameraType];
   if (self.localAudioTrack) {
     [self.localAudioTrack setEnabled:enableAudio];

This issue body was partially generated by patch-package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions