checkPhonePermissions method

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

Check if the package has the CALL_PHONE and READ_PHONE_STATE permissions.

Implementation

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