isApplePayAvailable method

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

Whether the current device can make Apple Pay payments.

Always returns false on non-iOS platforms.

Implementation

@override
Future<bool> isApplePayAvailable() async {
  try {
    final bool? available = await methodChannel.invokeMethod<bool>(
      'isApplePayAvailable',
    );
    return available ?? false;
  } on PlatformException catch (e) {
    log("Noon Apple Pay availability error: '${e.code}' - '${e.message}'");
    return false;
  } on MissingPluginException {
    // Method not implemented on this platform (e.g. Android).
    return false;
  }
}