rejectCallOnNoPermissions method

  1. @override
Future<bool> rejectCallOnNoPermissions({
  1. bool shouldReject = false,
})
override

Reject call when no CALL_PHONE permissions are granted nor Phone Account (via isPhoneAccountEnabled) is registered. If set to true, the call is rejected immediately upon received. If set to false, the call is left until the timeout is reached / call is canceled. Defaults to false.

Only available on Android

Implementation

@override
Future<bool> rejectCallOnNoPermissions({bool shouldReject = false}) {
  if (defaultTargetPlatform != TargetPlatform.android) {
    return Future.value(true);
  }
  return _channel.invokeMethod<bool?>('rejectCallOnNoPermissions', {"shouldReject": shouldReject}).then<bool>((bool? value) => value ?? false);
}