requestPhonePermissions method

  1. @override
Future<bool> requestPhonePermissions()
override

Requests the necessary permissions natively, without third-party dependencies.

Implementation

@override
Future<bool> requestPhonePermissions() async {
  if (Platform.isIOS) return true; // iOS has no CALL_PHONE permission model
  try {
    final bool? granted = await methodChannel.invokeMethod(
      'requestPhonePermissions',
    );
    return granted ?? false;
  } on PlatformException catch (e) {
    debugPrint("Error requesting permissions: ${e.message}");
    return false;
  }
}