rejectCall static method
void
rejectCall(
- String sessionID,
- String status, {
- required dynamic onSuccess(
- Call call
- required dynamic onError(
- CometChatException excep
Implementation
static void rejectCall(String sessionID, String status,
{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 if (status.isEmpty) {
onError(CometChatException(
"Error", "Call status is null", "Call status is null"));
} else {
var result = await channel.invokeMethod(
'rejectCall', {"sessionID": sessionID, "status": status});
if (onSuccess != null) onSuccess(Call.fromMap(result));
}
} on PlatformException catch (p) {
_errorCallbackHandler(null, p, null, onError);
} catch (e) {
_errorCallbackHandler(null, null, e, onError);
}
}