answer method
Answers the incoming call.
Additional call parameters are set up via settings
: video direction
for the call, preferred video codec, custom data.
Optional settings
- Additional call parameters like video direction
for the call, preferred video codec, custom data.
Throws VIException, if an error occurred.
Errors:
- VICallError.ERROR_MISSING_PERMISSION - Android only. If permissions are not granted for the call: audio calls - RECORD_AUDIO video calls - RECORD_AUDIO and CAMERA
- VICallError.ERROR_INCORRECT_OPERATION - Android only. If the call is already answered.
Implementation
Future<void> answer({VICallSettings? settings}) async {
try {
if (settings == null) {
settings = VICallSettings();
}
await _channel.invokeMethod<void>('Call.answerCall', <String, dynamic>{
'callId': _callId,
'sendVideo': settings.videoFlags.sendVideo,
'receiveVideo': settings.videoFlags.receiveVideo,
'videoCodec': settings.preferredVideoCodec.toString(),
'customData': settings.customData,
'extraHeaders': settings.extraHeaders
});
} on PlatformException catch (e) {
throw VIException(e.code, e.message);
}
}