endCall static method
void
endCall(
- String sessionID, {
- required dynamic onSuccess(
- Call call
- required dynamic onError(
- CometChatException excep
Implementation
static void endCall(String sessionID,
{required Function(Call call)? onSuccess,
required Function(CometChatException excep) onError}) async {
try {
if (sessionID.isEmpty) {
onError(CometChatException(
"Error", "Session ID is null", "Session ID is null"));
} else {
var result =
await channel.invokeMethod('endCall', {"sessionID": sessionID});
if (onSuccess != null) onSuccess(Call.fromMap(result));
}
} on PlatformException catch (p) {
_errorCallbackHandler(null, p, null, onError);
} catch (e) {
_errorCallbackHandler(null, null, e, onError);
}
}