Skip to content

List Apple Wallet passes and activate them in-app - #2

Open
wachunei wants to merge 1 commit into
MetaMask:mainfrom
Brunonascdev:feat/ios-wallet-pass-activation
Open

wachunei wants to merge 1 commit into
MetaMask:mainfrom
Brunonascdev:feat/ios-wallet-pass-activation

Conversation

@wachunei

Copy link
Copy Markdown
Member

Details

Adds two iOS functions so an app can show a card's verification state and finish activation without sending the user to Wallet:

  • listAppleWalletPasses() returns every Secure Element pass on the iPhone and on a paired Apple Watch, with activationState (requireActivation, pending, active, and the other CardStatus values) and isRemote.
  • activateAppleWalletPass({ passTypeIdentifier, serialNumber, activationData, isRemote }) activates a pass that is waiting for activation. isRemote selects the Watch pass when the same card is on both devices.

Ported from ShpetimA/react-native-wallet (d122f802, ca6c4044), adapted to current main: the old architecture reads struct fields with the existing per-parameter #ifdef, and Android gets no-op stubs so the shared TurboModule spec still builds.

getCardStatusBySuffix and getCardStatusByIdentifier are unchanged and still report only the iPhone pass.

Related Issues

Expensify#84
Expensify#45

Manual Tests

  • On an iPhone with a card in Wallet, call listAppleWalletPasses() and confirm the pass is returned with isRemote: false and an activationState.
  • Pair an Apple Watch that has the same card (or only the Watch has it). Confirm a second entry with isRemote: true, and that a Watch-only card is no longer reported as not found.
  • For a pass in requireActivation, call activateAppleWalletPass with issuer activation data and the matching isRemote flag. Confirm it resolves true and a following list shows active.
  • Confirm activateAppleWalletPass rejects when activation data is not base64, the pass is missing, or the pass is not eligible.
  • Confirm both functions are safe to import on Android: listing resolves [], and activation throws.

Linked PRs

Expensify#91 also edits the TurboModule spec, the README function table, and WalletManager.swift / RNWallet.mm. Whichever lands second will need a small rebase. This PR does not depend on Expensify#91.

Apps can read each pass's activation state on the iPhone and a paired Watch, then finish verification without leaving the app.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants