Closed garrettApproachableGeek closed 2 years ago
I am also struggling with this issue. Unsure how to proceed as I believe I need to use a native PKAddPassButton to provision cards, but unsure how to do this in Flutter.
I will note though, that the example app does run (once you run a flutter upgrade) - but I need to create a pass from an issuance token which is where my problems lie.
KPatel91 are you attempting to add passes to Apple wallet or a credit card to Apple wallet? This package is built to add passes to Apple wallet not credit cards.
Since you are using the word provision and cards, I think you are referring to push provisioning, which this package doesn't cover at all.
Ah, yeah indeed I am trying to provisioning an Access Card rather than a QR pass.
This is becoming quite the struggle for me then, guess I need to learn how to create native iOS widgets in Flutter since no package exists for my use case.
Resolved by using https://pub.dev/packages/pass_flutter and https://pub.dev/packages/add_to_wallet together to add passes directly to the Apple Wallet
The current application has the wallet capability Using Flutter: 3.0.3 add_to_wallet: 0.0.2
Code used,
data
isList<int>
of https://github.com/barkibu/add_to_wallet/blob/main/example/assets/passes/health_id_card_sample.pkpassCrash message
Crashed thread stack trace
I dug into this a bit and if SwiftAddToWalletPlugin.swift is modified to the following code, then casting error is fixed but then this error is thrown
Error Domain=PKPassKitErrorDomain Code=1 "The pass cannot be read because it isn’t valid." UserInfo={NSLocalizedDescription=The pass cannot be read because it isn’t valid., NSUnderlyingError=0x281585bc0 {Error Domain=PKPassKitErrorDomain Code=1 "(null)"}}