Skip to content

fix(#305): add Apple Wallet pass support to the v5 WebView#309

Merged
cassio-rossi merged 2 commits into
release/v5from
fix/wallet-pass-support
Jul 17, 2026
Merged

fix(#305): add Apple Wallet pass support to the v5 WebView#309
cassio-rossi merged 2 commits into
release/v5from
fix/wallet-pass-support

Conversation

@cassio-rossi

@cassio-rossi cassio-rossi commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Fixes Impossibilidade de adicionar tíquetes ao Carteira pelo app #305.pkpass ticket links (event tickets, e.g. WWDC keynote) opened a raw-file screen instead of the "Add to Wallet" flow.
  • Mirrors release/v4's WebViewController PassKit handling, adapted to v5's WebPage/MMWebView navigation stack: URLClassifier now recognizes .pkpass links (checked before host-based classification, since tickets are hosted on macmagazine.com.br itself), MMNavigationDecider routes them through a new onOpenWalletPass callback, and a new WalletPassSheet downloads the pass via the existing Network abstraction and hands it to PKAddPassesViewController.
  • No changes needed to the external cassio-rossi/Libraries package — its Network product already exposes everything required. Only MacMagazineUILibrary/Package.swift gained a dependency on the existing Network product.

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 new URLClassifierTests (.walletPass cases) and WalletPassServiceTests (network-failure and invalid-pass-data paths)
  • swiftlint lint --strict — 0 violations across 239 files
  • Manual on-device verification of the real "Add to Wallet" flow against a live ticket link (not practical to unit-test — requires a real signed .pkpass)

🤖 Generated with Claude Code

cassio-rossi and others added 2 commits July 17, 2026 18:47
.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>
@cassio-rossi
cassio-rossi merged commit 8763830 into release/v5 Jul 17, 2026
2 checks passed
@cassio-rossi
cassio-rossi deleted the fix/wallet-pass-support branch July 17, 2026 18:19
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.

Impossibilidade de adicionar tíquetes ao Carteira pelo app

1 participant