iOS setAutoConnectInternetAudio

Description
Hi, we’re trying to get our app to auto connect to internet audio so users don’t have to tap to enable. We’re experiencing some weird behavior when making the connection and can’t figure out how to get it to work properly.

I’d appreciate any help or guidance users or Zoom could offer here. To be quite honest we’ve inherited a rough code base and it wouldn’t surprise me if we’re way off base.

Thanks in advance!

We are using mieszko’s react native bridge GitHub - mieszko4/react-native-zoom-us but it seems our problem is in the objective-c layer. I’ve attached the relevant code below for joining the meeting.

What we’re seeing now is:

If we set joinParam.noAudio = **NO** ; joinParam.noVideo = **NO** ; then the meeting connects fine - but without auto connecting audio.

If we set noAudio & noVideo = YES then we get the following in the console and the meeting never connects, we just get the “waiting” spinner

**2021-02-03 12:09:47.335007-0800 Ortholive[19335:4348033] nZoomSDKInitializeResult, errorCode=0**

**2021-02-03 12:09:47.350769-0800 Ortholive[19335:4348033] joinMeeting, joinMeetingResult=0**

Which version?
5.0.24433.0616 & Miezko4’s React Native Zoom Us GitHub - mieszko4/react-native-zoom-us

  • I know RNZoomUS isn’t an official Zoom library, however it seems like the issue I’m having here is at a lower level.

Relevant Code

RCT_EXPORT_METHOD(

joinMeeting: (NSDictionary *)data
withResolve: (RCTPromiseResolveBlock)resolve
withReject: (RCTPromiseRejectBlock)reject
)
{
@try {
meetingPromiseResolve = resolve;
meetingPromiseReject = reject;

MobileRTCMeetingService *ms = [[MobileRTC sharedRTC] getMeetingService];
if (ms) {
  ms.delegate = self;

  MobileRTCMeetingJoinParam * joinParam = [[MobileRTCMeetingJoinParam alloc]init];
  joinParam.userName = data[@"userName"];
  joinParam.meetingNumber = data[@"meetingNumber"];
  joinParam.password =  data[@"password"];
  joinParam.participantID = data[@"participantID"];
  joinParam.zak = data[@"zoomAccessToken"];
  joinParam.webinarToken =  data[@"webinarToken"];
  joinParam.noAudio = NO;
  joinParam.noVideo = NO;
  [ms connectMyAudio: YES];
  MobileRTCMeetingSettings *settings = [[MobileRTC sharedRTC] getMeetingSettings];
  [[[MobileRTC sharedRTC] getMeetingSettings] setAutoConnectInternetAudio:YES];
  MobileRTCMeetError joinMeetingResult = [ms joinMeetingWithJoinParam:joinParam];

    BOOL isAutoConnected = [settings autoConnectInternetAudio];
    BOOL isAudioMuted = [settings muteAudioWhenJoinMeeting];
    BOOL isVideoMuted = [settings muteVideoWhenJoinMeeting];
    BOOL disabled = [settings driveModeDisabled];
    BOOL disabledCallIn = [settings callInDisabled];
    BOOL disabledCallOut = [settings callOutDisabled];


    
  NSLog(@"joinMeeting, joinMeetingResult=%d", joinMeetingResult);
}

} @catch (NSError *ex) {
reject(@“ERR_UNEXPECTED_EXCEPTION”, @“Executing joinMeeting”, ex);
}
}

Hey @benmurphy_zoom,

Thanks for using the dev forum!

I know it is a bit confusing but the error code 0 in this case means success.

Setting noAudio to true means that the meeting will be a video only meeting until the user manually connects their audio. The same goes for noVideo respectively.
Setting these to false does not automatically connect them, rather it enables them to be connected automatically. You would set these to yes to have a audio only or video only meeting respectively.

To connect the audio you would have to wait until the user has successfully joined the meeting then you would call the connectMyAudio function from the MobileRTCMeetingService.

For your use case, I dont think you should need to set the noAudio/noVideo params at all.

Thanks!
Michael

Thanks Michael -that makes sense. I’ll give it a try. I appreciate your advice.

Hey @benmurphy_zoom,

Sounds good! Let me know how it goes.

Thanks!
Michael