Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: updating connect params and avoiding pointers #759

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

CaptainJeff
Copy link
Contributor

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.

@CaptainJeff
Copy link
Contributor Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant