I want to add a custom button in the meeting option toolbar in my zoom app in ios. I see there are provisions to hide or show the toolbar or even specific buttons. But is there any way to add a custom button in the toolbar under more in IOS?

Hey @zacob,

We are in the process of creating better documentation for this area of the SDK. In the meantime, I can gladly help with your integration :slight_smile:

The way I have set my own Zoom SDK application up is like this.

  1. I enable custom meeting UI and I assign my main viewcontroller to be a MobileRTCCustomizedUIMeetingDelegate
  2. The MobileRTCCustomizedUIMeetingDelegate is my main viewcontroller, and it simply presents another viewcontroller when onInitMeetingView is triggered. This second viewcontroller is my customMeetingUIViewController that will actually show my meeting controls and video streams.
  3. I also assign my customMeetingUIViewController to be my MobileRTCMeetingServiceDelegate, so that it can listen to meeting events and react accordingly.

1:

guard let meetingService = MobileRTC.shared().getMeetingService() else { return }

// This is in my mainViewController
meetingService.customizedUImeetingDelegate = self

2:

extension ViewController: MobileRTCCustomizedUIMeetingDelegate {
    // Called when local user joins a meeting, and when the local user has been admitted to meeting from waiting room.
    func onInitMeetingView() {
        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
    }

    func onDestroyMeetingView() {
        MobileRTC.shared().getMeetingService()?.delegate = self
    }
}

3:

@objc class CustomMeetingUIViewController: UIViewController {
    // My views and properties are here
    
    // My button actions are here. Note, I made an SDK wrapper called SDKManager to keep things organized, but this isnt required.
    @IBAction func leaveMeetingButtonPressed(_ sender: Any) {
        SDKManager.leaveMeeting()
    }

    @IBAction func endMeetingButtonPressed(_ sender: Any) {
        SDKManager.endMeeting()
    }
    // ...

    override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(animated)
        updateViews()
    }

    private func updateViews() {
    // View updates are handled here, this is basically psuedocode
        if let firstRemoteUser = SDKManager.remoteUserIDsInMeeting()?.first as? UInt, let remoteUserVideoView = SDKManager.remoteUserVideoView(userID: firstRemoteUser, videoAspect: MobileRTCVideoAspect_PanAndScan, frame: remoteUserView.frame) {
            DispatchQueue.main.async { [weak self] in
                self?.remoteUserView.addSubview(remoteUserVideoView)
            }
        }
        // ...
    }
}

extension CustomMeetingUIViewController: MobileRTCMeetingServiceDelegate {
  // This is where all of my meeting service delegate callbacks are handled. I removed a lot of code here just to simplify this post, but I think you get the idea. 

    // Called when joining a meeting and when being admitted from the waiting room.
    func onMeetingReady() {
    }

    func onJoinMeetingConfirmed() {
    }

    func onJBHWaiting(with cmd: JBHCmd) {
    }

    func onWaitingRoomStatusChange(_ needWaiting: Bool) {
        updateViews()
    }

    func onMeetingStateChange(_ state: MobileRTCMeetingState) {
        print("** meeting state \(state.name)")
        currentMeetingStateLabel.text = state.name
    }

    func onMeetingError(_ error: MobileRTCMeetError, message: String?) {
        mostRecentMeetErrorLabel.text = error.name
    }

    func onJoinMeetingInfo(_ info: MobileRTCJoinMeetingInfo, completion: @escaping (String, String, Bool) -> Void) {

    }
}

Thanks!
Michael

2 Likes