Repository navigation
List Apple Wallet passes and activate them in-app - #96
Brunonascdev wants to merge 3 commits into
Conversation
Apps can read each pass's activation state on the iPhone and a paired Watch, then finish verification without leaving the app.
JakubKorytko
left a comment
There was a problem hiding this comment.
One thing on the isRemote lookup
| return pass.secureElementPass | ||
| } | ||
|
|
||
| if isRemote == false { |
There was a problem hiding this comment.
The iPhone-then-Watch fallback only runs when isRemote is nil, but it never is: TS requires it, the new arch always passes a bool, and the old arch maps missing to false. So a caller passing false for a Watch-only card gets "Secure Element pass not found". Could we make isRemote optional end to end (isRemote?: boolean in TS, nil from RNWallet.mm when missing) so the fallback actually runs?
There was a problem hiding this comment.
isRemote is optional end to end. The new architecture only sets it when the value is present, and the old architecture only when it is a boolean. A missing value stays nil, so the iPhone-then-Watch lookup runs. The README describes that.
|
@Brunonascdev gentle bump & please merge main 🙏 |
A missing flag now reaches the iPhone-then-Watch lookup instead of being treated as the iPhone.
|
Merged current |
|
@JakubKorytko this is ready for another look. Requesting a review from the fork returns a permissions error, so this comment is the ping. |
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, withactivationState(requireActivation,pending,active, and the otherCardStatusvalues) andisRemote.activateAppleWalletPass({ passTypeIdentifier, serialNumber, activationData, isRemote })activates a pass that is waiting for activation.isRemoteselects the Watch pass when the same card is on both devices. It is optional. Omit it to look up the iPhone pass first and then a paired Apple Watch. The new architecture only forwards the flag when it is present, and the old architecture only when the value is a boolean, so a missing flag stays nil and the fallback runs.Ported from ShpetimA/react-native-wallet (
d122f802,ca6c4044), adapted to currentmain: 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.getCardStatusBySuffixandgetCardStatusByIdentifierare unchanged and still report only the iPhone pass.Merged current
main.Related Issues
#84
#45
Manual Tests
This repo has no automated tests. Typecheck and lint pass. The example app builds for the iOS simulator with the new architecture. Android was not compiled here: the example app does not include the TapAndPay SDK. The Kotlin changes are stubs.
listAppleWalletPasses()and confirm the pass is returned withisRemote: falseand anactivationState.isRemote: true, and that a Watch-only card is no longer reported as not found.requireActivation, callactivateAppleWalletPasswith issuer activation data and the matchingisRemoteflag. Confirm it resolvestrueand a following list showsactive.activateAppleWalletPasswithoutisRemotefor a Watch-only pass. Confirm it activates that pass instead of failing with "Secure Element pass not found".activateAppleWalletPassrejects when activation data is not base64, the pass is missing, or the pass is not eligible.[], and activation throws.Linked PRs
#91, #132, #133, and #134 also edit the spec, the README, or
WalletManager.swift/RNWallet.mm. Whichever lands second will need a small merge. This PR does not depend on #91.