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 (exception) {
onError(CometChatException(exception.code, exception.message, exception.details));
} catch (e) {
onError(CometChatException("Error", "Something went wrong", e.toString()));
}
}