entryready_wallet 0.1.0
entryready_wallet: ^0.1.0 copied to clipboard
Add EntryReady mobile keys to Apple Wallet. Presents PassKit's provisioning sheet, reports what is already in the wallet, and ships Apple's Add to Apple Wallet button.
Changelog #
0.1.0 #
First release.
Apple Wallet in-app provisioning for EntryReady mobile keys, covering the device half of an integration. The package does not call the EntryReady API — your application does, and hands the results here.
Added #
EntryReadyWallet.keyStatus(referenceIdentifiers:)— where a key's pass is, as aWalletKeyStatus(notProvisioned,onThisDeviceOnly,onPairedDeviceOnly,onBoth). A pass counts only when itsprimaryAccountIdentifiermatches one of the supplied identifiers and the wallet reports it activated, so an unrelated credential in the same wallet cannot satisfy it.WalletKeyStatus.shouldOfferButton— Apple's display rule: hide only once the pass is on both the phone and a paired device.WalletKeyStatus.note— user-facing copy for the partial states, where a pass is on one device but not the other.EntryReadyWallet.addKey(credentials:, preview:)— presents Apple's provisioning sheet for a credential prepared byPOST /mobilekeys/preparePushProvisioning. TakesPassCredentialsandPassPreview.EntryReadyWallet.diagnose()— why provisioning is unavailable, as aWalletDiagnosis. Reports Wallet availability, Simulator, visible pass count, and whether the embedded provisioning profile carries the entitlement. Exists because a missing entitlement makes pass queries return empty rather than fail, which is otherwise indistinguishable from a user with no passes.AddToAppleWalletButton— Apple'sPKAddPassButtonas a platform view, since Apple requires their own control.EntryReadyWallet.passes()andisAvailable()— the raw queries, for diagnostics and for callers correlating several keys at once.WalletExceptionwith aWalletErrorCode, so callers branch on an enum instead of parsing message strings.isCancellationseparates a dismissed sheet from a real failure.- A
plugin_platform_interfaceseam, so an integrating application can substitute a fake and test its wallet flow with no device and no entitlement.
Requirements #
- iOS 16.0. The shareable-pass APIs this package uses —
PKShareablePassMetadata's preview initializer andPKAddShareablePassConfiguration.forPassMetadata(_:action:completion:)— are bothAPI_AVAILABLE(ios(16.0)). OnlyPKAddSecureElementPassViewControllerand the pass queries date back to 13.4, so a lower target compiles the queries and fails on the provisioning call. - The
com.apple.developer.contactless-payment-pass-provisioningentitlement withshareablecredential, granted through Apple's Wallet Access Key program and bound to your bundle identifier. Manual signing is required; automatic signing cannot mint a profile carrying it. - A real device. The Simulator has no Secure Element.
Not included #
No EntryReady API client, no authentication, and no reservation or booking concepts. Those belong to the integrating application.
Android is not implemented. Google and Samsung wallets need an oems/getLink nonce handshake that
Apple's flow does not, so it is deliberately not stubbed in as if it were a minor difference.