Joining a meet

Prerequisites#

Meet sdk should be initialised, group call feature has to be enabled for the current plan and a valid Meetlink should be available.

info

Calling CallManager.createMeetlink() method will provide a unique meet id everytime.

For better user experience, users could be presented with a preview screen to observe the meet events, render local preview video, option to switch camera and mute the audio or video even before joining the call. We can make use of the below methods for preview screen UI implementations.

Setup#

We must establish a connection to the meet server for further subscription, for that we need to call the below method before calling any other methods related to Meet.

CallManager.setupJoinCallViaLink()
caution

Make sure to clean up meet data by the calling this Unsubscribe method before joining or to cancel a meet.

Subscribe#

SDK require the User to subscribe the link before joining the meetaSDK requires the User to subscribe the link before joining the meet.Successful subscription will let us know of the participants of the ongoing meet and provide realtime updates of newly joined and recently left participates too. Also let the developers restrict the participants to a meet based on the requirements.

    CallManager.subscribeToCallEvents(CALL_ID, USER_NAME){ isSuccess,message in }
    ArgumentTypeDescription
    CALL_IDStringGenerated call link id for an ongoing call. E.g. (ght-trt-wkk)
    USER_NAMEStringusername of the current user
    (isSuccess,message)(Bool,String))completion handler to post response

    if isSuccess returns false, then you need to show error message to the user and close the UI.

    caution

    Make sure to ask for the Camera and Microphone access in th UI before joining/subscribing to a meet. Without Microphone permission SDK won't let users join a meet.

    Observe#

    To observe the subscription events triggered by sdk, we need to conform to the JoinCallDelegate protocol provided by the SDK. To set the delegate call the method below.

    CallManager.setJoinCallDelegate(JOIN_CALL_DELEGATE)
    ArgumentTypeDescription
    JOIN_CALL_DELEGATEJoinCallDelegateUIViewController that conforms to the delegate

    The protocol contains the following delegate methods and will be triggered by the SDK based on the events received from the server accordingly.We can update the UI based on the data we received from these methods.

    func onUsersUpdated(usersList:[String])
    func onLocalTrack(videoTrack: RTCVideoTrack?)
    func onError(reason : String)

    onLocalTrack event will be fired once you called startVideoCapture() from the sdk provided all the required permissions were already granted.

    onUsersUpdated event will be fired whenever there is a change in users list for the call, you can use this to update the users list in the UI. Users list is provided as an array of user's id.

    onError event will be fired whenever there is a error occurred while joining the meet.

    Unsubscribe#

    Once Subscription was called, unsubscribing to the link was necessary to dispose the meet data to avoid memory leaks and unnecessary resource usage. We must call the below method to unsubscribe to a meet link.

    CallManager.cleanUpJoinCallViaLink()

    Join#

    After successful subscription, we can call the below method to start joining in the ongoing meet.

    CallManager.joinCall{isSuccess,flyError in
    if isSuccess {
    // Dismiss the preview screen
    }
    }

    End#

    If you want to disconnect an ongoing meet at the end of conversation or when the user presses the end button of your meet UI , you need to call the below sdk method to disconnect the meet.

      CallManager.disconnectCall()