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) {
    // On iOS, the permissions are not required for USSD, so we can return true.
    return true;
  }
  final bool? hasPermission = await methodChannel.invokeMethod(
    'checkPhonePermissions',
  );
  return hasPermission ?? false;
}