feat(targets): add Apple Wallet In-App Provisioning extensions (`wall…#188
Open
kliakhovskii-brex wants to merge 1 commit intoEvanBacon:mainfrom
Open
feat(targets): add Apple Wallet In-App Provisioning extensions (`wall…#188kliakhovskii-brex wants to merge 1 commit intoEvanBacon:mainfrom
kliakhovskii-brex wants to merge 1 commit intoEvanBacon:mainfrom
Conversation
…et`, `wallet-ui`) (#1) * feat(targets): add Apple Wallet In-App Provisioning extensions Adds two new target types for implementing Apple Wallet In-App Provisioning Extensions, which let users add an issuer's payment passes to Apple Wallet directly from Wallet's '+' menu: - 'wallet' — Non-UI extension (PKIssuerProvisioningExtensionHandler) extension point: com.apple.PassKit.issuer-provisioning - 'wallet-ui' — Authorization UI extension (PKIssuerProvisioningExtensionAuthorizationProviding) extension point: com.apple.PassKit.issuer-provisioning.authorization Both targets: - link the PassKit framework (UI also links UIKit) - mirror app groups from the main target by default (host app and extensions communicate via a shared App Group container) - recommend the com.apple.developer.payment-pass-provisioning entitlement in the create-target scaffold (still requires private Apple allow-listing — see https://applepaydemo.apple.com/in-app-provisioning-extensions) Includes Swift templates, e2e fixture configs, README entries, and unit-test snapshot updates. Co-authored-by: Konstantin Liakhovskii <kliakhovskii-brex@users.noreply.github.com> * docs: shorten wallet target descriptions to fit table width Co-authored-by: Konstantin Liakhovskii <kliakhovskii-brex@users.noreply.github.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Konstantin Liakhovskii <kliakhovskii-brex@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Apple Wallet In-App Provisioning Extensions let users add an issuer's payment passes to Apple Wallet directly from Wallet's "+" menu (under "From Apps on Your iPhone"), without having to open the issuer app first. The feature is implemented as two app extensions working together:
PKAddPaymentPassRequestto Wallet.UIViewControllerWallet presents to authenticate the user when the non-UI extension reportsrequiresAuthentication = true.We already implement these natively in the Brex
mobilerepo for the core app. With Continuous Native Generation via@bacons/apple-targets, we can scaffold and link these targets the same way we do widgets, share extensions, etc. — and once this lands here we can also push it upstream.Reference: https://applepaydemo.apple.com/in-app-provisioning-extensions
Execution
Followed the "Adding a new target type" checklist in
CLAUDE.md. All edits are derived from the centralTARGET_REGISTRYso theExtensionTypeunion, extension-point ID map, framework list, CLI list, and e2e coverage check pick the new types up automatically.packages/apple-targets/src/target.tsAdded two entries to
TARGET_REGISTRY:walletcom.apple.PassKit.issuer-provisioningPassKitwallet-uicom.apple.PassKit.issuer-provisioning.authorizationPassKit,UIKitApp Groups default to mirroring the main app because Wallet extensions are documented to share state with the containing issuer app via a shared App Group container (the host — Wallet — and the containing issuer app cannot communicate directly).
Added
Info.plistcases ingetTargetInfoPlistForType()that wire the principal classes to:$(PRODUCT_MODULE_NAME).IssuerProvisioningHandler(non-UI)$(PRODUCT_MODULE_NAME).IssuerProvisioningAuthorizationViewController(UI)packages/apple-targets/src/configuration-list.tsBoth new types fall through to
createDefaultConfigurationList()— they don't need any of the special build-setting customizations (no asset catalog accent color, no watchOS SDK, etc.).packages/create-target/templates/wallet/IssuerProvisioningHandler.swiftPKIssuerProvisioningExtensionHandlersubclass with all four non-deprecated methods overridden (Apple requires this — they must not callsuper). Returns "no passes available" by default; issuers fill in the methods.packages/create-target/templates/wallet-ui/IssuerProvisioningAuthorizationViewController.swiftUIViewControlleradoptingPKIssuerProvisioningExtensionAuthorizationProvidingwith acompletionHandlerproperty and convenience helpers to report.authorized/.canceled.packages/create-target/src/createAsync.tsAdded
com.apple.developer.payment-pass-provisioningas the recommended entitlement for both new targets in the scaffold output. (This is a private Apple entitlement — issuers still have to emailapplepayentitlements@apple.comto be allow-listed; the Swift will compile without it but Wallet won't surface the extensions until Apple grants the entitlement.)E2E + docs
e2e/fixture/targets/wallet/expo-target.config.jsonandwallet-ui/expo-target.config.json.e2e/__tests__/build.test.tsTARGET_REGISTRY(targetnameswalletandwalletui).__tests__/createAsync.test.tssnapshot list updated; new snapshots auto-generated.Test Plan
Ran from the workspace root with
bun:Snapshot output for the new types looks like:
The exhaustive
neverswitch ingetConfigurationListBuildSettingsForType()and the e2e meta-test ("registry covers all ExtensionType values") would have failed if either new type were missed — both pass.The
xcodebuilde2e suite requires macOS + Xcode, so it can't run in this Linux cloud agent. Once the branch is reviewed it can be exercised on the macOS CI runner that the repo already uses fortest:e2e(the newwallet/wallet-uicases will run automatically alongside the other 40+ targets).