fix(#305): add Apple Wallet pass support to the v5 WebView#309
Merged
Conversation
.pkpass ticket links (e.g. WWDC keynote tickets) fell through to URLClassification.external and were handed to UIApplication.open, which just rendered the raw file instead of the Wallet flow that release/v4's WebViewController handled via PassKit. Mirrors v4's approach on v5's WebPage-based navigation stack: URLClassifier now recognizes .pkpass links before host-based classification, MMNavigationDecider routes them through a new onOpenWalletPass callback, and MMWebView presents a WalletPassSheet that downloads the pass via the existing Network abstraction and hands it to PKAddPassesViewController. Co-Authored-By: Claude <noreply@anthropic.com>
CI's SwiftLint (installed unpinned via brew, currently 0.65.0) no longer flags URL(string:)! as a force_unwrapping violation, unlike the 0.59.1 used locally. That made the pre-existing blanket disable in URLClassifierTests.swift, and the one I added in WalletPassServiceTests.swift, both superfluous under --strict. Removed both; verified 0 violations with swiftlint 0.65.0 to match what CI actually runs. Co-Authored-By: Claude <noreply@anthropic.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.
Summary
.pkpassticket links (event tickets, e.g. WWDC keynote) opened a raw-file screen instead of the "Add to Wallet" flow.release/v4'sWebViewControllerPassKit handling, adapted to v5'sWebPage/MMWebViewnavigation stack:URLClassifiernow recognizes.pkpasslinks (checked before host-based classification, since tickets are hosted on macmagazine.com.br itself),MMNavigationDeciderroutes them through a newonOpenWalletPasscallback, and a newWalletPassSheetdownloads the pass via the existingNetworkabstraction and hands it toPKAddPassesViewController.cassio-rossi/Librariespackage — itsNetworkproduct already exposes everything required. OnlyMacMagazineUILibrary/Package.swiftgained a dependency on the existingNetworkproduct.Test plan
xcodebuild build— succeeds (iPhone 17 Pro simulator unavailable on this machine; verified on iPhone 17 Pro Max instead)xcodebuild test -testPlan MacMagazine— all suites pass, including newURLClassifierTests(.walletPass cases) andWalletPassServiceTests(network-failure and invalid-pass-data paths)swiftlint lint --strict— 0 violations across 239 files.pkpass)🤖 Generated with Claude Code