How to leave the session from the program

When UI Toolkit video session start, I can only leave this session by clicking the red telephone button on right top. How can I leave session from the program.
I tried
zoom.onSessionLeave()
but the session does not leaved.
Is there any proper method to leave on Swift?

Hi @cmiyaji ,

With the UI Toolkit, you can programmatically leave a session by calling uitoolkit.closeSession(sessionContainer). See our documentation for more information, and please let me know if this answers your question!

Thanks,
Rehema

Thank Rehma for answering my question.
I use Swift, and use GIT ui toolkit sample to test. It opens zoom session
let vc = UIToolkitVC(sessionContext: SessionContext(jwt: jwt, sessionName: sessionName, username: username))
But this vc does not have closeSession () method.
where I’ll find closeSeesion() method?

Dear Rehema

I found the method eventually, dismiss(…) is the method to leave the session.
open the zoom,
self.zoom = UIToolkitVC(sessionContext: SessionContext(jwt: info.jwt, sessionName: info.sessionName, username: info.userIdentity))
and close it by
self.zoom.dismiss(animated: true)
close the session.

This is what I want for closing the session, but I have a bit different session control to pause it. I’ll write on different topic, I’m glad that you’ll show the solution.