addPasses method

Future<void> addPasses(
  1. List<Uint8List> passes
)

Adding payment passes requires a special entitlement issued by Apple. If your app does not include this entitlement, this method returns nil. For more information on requesting this entitlement, see the Card Issuers section on developer.apple.com/apple-pay/.

Implementation

Future<void> addPasses(List<Uint8List> passes) async {
  final nonEmptyPasses = passes.where((p) => p.isNotEmpty).toList();
  if (nonEmptyPasses.isEmpty) {
    return;
  }
  await wrapWithException(methodChannel.invokeMethod<void>(
    'addPassesViewController',
    nonEmptyPasses,
  ));
}