react-native-twilio-video-webrtc
react-native-twilio-video-webrtc copied to clipboard
fix: updating connect params and avoiding pointers
I just started to experience an issue where my "connect" function wasn't getting called in objective-c. Aftering some debugging, I realized that it was caused by the implementation of BOOL * instead of BOOL
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
) {
VS
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) {
In Objective-C, BOOL is a primitive, not a pointer. Using BOOL * (a pointer) is incorrect unless handling pointers, which we're not doing here. I'm thinking that the BOOL * type may confuse the RN bridge, causing it to drop the method call silently?
And then another change is the default param of encodingParameters from the js should be a dict not null.
@slycoder think you can give this a look? The current master branch doesn't work for me in ios. The connect request silently drops and the call is never connected.
@CaptainJeff This worked for me. Thanks.