Hey @zacob,
I think I see what is going on here. Calling the leave function while the internet is disconnected does not appear to execute the leave process since it has to alert the meeting the user has left.
Here is a workaround that worked for me:
Implement the onMeetingStateChange delegate callback:
func onMeetingStateChange(_ state: MobileRTCMeetingState) {
if state == .ended && leftWaitingRoom == false {
leftWaitingRoom = true
} else if state == .ended && leftWaitingRoom == true {
hasReconnected = true
}
}
Keep track of when the meeting state was .ended with a boolean, hasReconnected. Keep in mind when the user is admitted from the waiting room, the state will be .ended. So we are looking for the second time the state was .ended when using a waiting room. That is why I also have a “leftwaitingroom” boolean
In your onInitMeetingView method check if has reconnected is true, if so do not recreate your UI and call leave just for safety:
func onInitMeetingView() {
if hasReconnected == true {
MobileRTC.shared().getMeetingService()?.leaveMeeting(with: .leave)
return
}
guard let customMeetingUIVC = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "CustomMeetingUIViewController") as? CustomMeetingUIViewController,
let meetingService = MobileRTC.shared().getMeetingService() else { return }
meetingService.delegate = customMeetingUIVC
self.present(customMeetingUIVC, animated: false, completion: nil)
self.customMeetingUIViewController = customMeetingUIVC
updateViews()
}
Then in your onDestroyMeetingUI simply dismiss your UI as usual:
func onDestroyMeetingView() {
MobileRTC.shared().getMeetingService()?.delegate = self
updateViews()
return
}
Finally when calling joinMeeting set your hasReconnected bool back to false.
This seemed to work for me, when the user disconnects the UI is dismissed, then the .ended state happens, and we do not re-show our UI. After some time the user is automatically removed from the meeting and then the joinMeeting function can happen again.
Its a bit of a hacky solution, but this is not normally a use-case Zoom handles.
Thanks!
Michael