Leave Room

Once you're done with the meeting and want to exit, call leave on the HMSSDK instance that you created to join the room.

Before calling leave, remove the HMSUpdateListener instance as:

// updateListener is the instance of class in which HMSUpdateListener is implemented hmsSDK.removeUpdateListener(updateListener);

To leave the meeting, call the leave method of HMSSDK and pass the hmsActionResultListener parameter to get a success callback from SDK in the onSuccess override method as follow.

You will need to implement the HMSActionResultListener interface in a class to get onSuccess and onException callback. To know about how to implement HMSActionResultListener check the docs here

class Meeting implements HMSActionResultListener{ //this is the instance of class implementing HMSActionResultListener hmsSDK.leave(hmsActionResultListener: this); void onSuccess( {HMSActionResultListenerMethod methodType = HMSActionResultListenerMethod.unknown, Map<String, dynamic>? arguments}) { switch (methodType) { case HMSActionResultListenerMethod.leave: // Room leaved successfully // Clear the local room state break; ... } } }

Have a suggestion? Recommend changes ->

Was this helpful?