reportCallEnded method

Future<void> reportCallEnded (
  1. String uuid,
  2. DateTime dateEnded,
  3. FCXCallEndedReason endedReason
)

Reports to the provider that a call with the specified identifier ended at a given date for a particular reason.

uuid is the unique identifier of the call.

dateEnded is the time at which the call ended. If null, the current time is used.

endedReason is the reason that the call ended.

Implementation

Future<void> reportCallEnded(
    String uuid, DateTime dateEnded, FCXCallEndedReason endedReason) async {
  try {
    await _methodChannel.invokeMethod('$_PROVIDER.reportCallEnded', {
      'uuid': uuid,
      'dateEnded': dateEnded?.toIso8601String(),
      'endedReason': endedReason?.index ?? FCXCallEndedReason.failed
    });
    _FCXLog._i('${runtimeType.toString()}.reportCallEnded');
  } on PlatformException catch (e) {
    var exception = FCXException(e.code, e.message);
    _FCXLog._e(exception);
    throw exception;
  }
}