Repository navigation
Build on watchOS and tvOS without paywalls - #594
Merged
Merged
Conversation
The package declared watchOS but never built there, and tvOS wasn't declared at all. Both lack WebKit, so everything that needs a paywall on screen is now behind `#if canImport(WebKit)`: the paywall view controller and presentation, debugger, Test Mode, Customer Center, permissions and the SDK's alerts. Purchases, observer mode, restores, entitlements, customer info, user attributes, events and web checkout redemption work as on iOS. - `register` runs the audience filters, then skips (holdout, no match, placement not found) or sends a code 108 error when a paywall would show. Implicit triggers and paywall preloading do nothing. - `getPresentationResult` returns the paywall the user would see. - Test mode never turns on, since its pickers can't be shown. - Superscript has no tvOS slice, so `Package.swift` drops it on tvOS and audience filters with an expression never match there. - watchOS gets WatchKit-backed device info, lifecycle notifications and `PlatformApplication`. MMP install matching is off on both. - Shared `@available` checks name matching watchOS/tvOS versions. - CI builds watchOS and tvOS. CocoaPods stays iOS/macOS only. Bumps to 4.20.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
The guard only stopped the paywall downloads, so the preload entry points still evaluated audiences, read occurrences from Core Data and could leave a queued task sleeping for five seconds. Guard the entry points instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
register used to send its own error whenever a paywall would show, so non-gated features never ran there. It now ends the way iOS does without internet: it fetches the paywall, and declines it with webViewFailedToLoad. Non-gated features run, gated ones get the existing web view error, and a failed fetch sends its error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
Reusing the web view failure path called onDismiss for a paywall that was never presented. register now passes its feature block down: a non-gated paywall runs it with no present or dismiss callbacks, and a gated one sends error 106. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
develop already stages 4.19.1, so the watchOS and tvOS entry joins that section instead of starting 4.20.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
This was referenced Nov 4, 2026
Audience filters now run on tvOS, so the Superscript condition and the canImport gates go. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Maple review🟢 Confidence 10/10 · safe to merge. Changes align dependency pins and restore existing evaluator behavior; native device linking was not independently run. The update pins Superscript 1.0.18 in SwiftPM and Xcode and restores the shared audience evaluator on tvOS. No new defects were found in the changes since the previous review.
|
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.
Changes in this pull request
A customer ships on several Apple platforms and wants observer mode everywhere, but SuperwallKit only built on iOS and macOS.
Package.swiftdeclared watchOS without it ever building, and tvOS wasn't declared at all.Neither platform has WebKit, so everything that needs a paywall on screen is now behind
#if canImport(WebKit): the paywall view controller and presentation, debugger, Test Mode, Customer Center, permissions and the SDK's alerts. Everything else works as on iOS: configure, identify, user attributes, events, purchases, restores, observer mode, subscription status, entitlements, customer info and web checkout redemption.Behaviour on watchOS and tvOS
registerruns the audience filters, then ends the way iOS does without internet. A holdout, no match or missing placement is skipped and runs the feature. If a paywall matches, it's fetched: non-gated features run, gated ones get error 106, and a failed fetch sends its error. No present or dismiss callbacks fire, since nothing is shown, soregisterpasses its feature block down on these platforms. This step (finishWithoutPaywallUI) builds on every platform so the iOS suite covers it.getPresentationResultreturns the paywall the user would see.PlatformApplication. The connection type is reported asUnknown.Other changes
@availablechecks now name the matching watchOS and tvOS versions.build-platforms.yml.develop, with a changelog entry, a docs page (WatchAndTV.md), a README platform row and CLAUDE.md notes.Testing
SystemWindowHidingTests.paywallTakenDownAgainBeforeItsDelayedAppearanceIsNotLeftPresentedfailed once in the full run, then passed 3 out of 3 times on its own. This PR doesn't touch that code.Uses Superscript 1.0.18
With Superscript 1.0.17, a watch app using SuperwallKit fails to link on a real device: Superscript's watchOS device build only has
arm64_32, but Xcode builds watch apps forarm64too. CI only builds the package, so it doesn't catch that. 1.0.17 also had no tvOS build.superwall/superscript#64 and superwall/superscript-ios-next#3 added both, and this PR uses the published 1.0.18, so audience filters run on every platform. The podspec stays on the
Superscriptpod 1.0.17, because CocoaPods Trunk is read-only this week and didn't accept 1.0.18. CocoaPods only installs on iOS and macOS, so it doesn't need the new slices.Checklist
CHANGELOG.mdfor any breaking changes, enhancements, or bug fixes.swiftlintin the main directory and fixed any issues.🤖 Generated with Claude Code


Confidence Score: 5/5
The reviewed changes appear safe to merge.Summary
Adds watchOS and tvOS support through Swift Package Manager without paywall screens.
No new actionable issues were found in the changes since the previous review. Tests and Apple-platform builds were not run during this review.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A["register on watchOS or tvOS"] --> B["Evaluate audience"] B -->|Skipped| C["Call onSkip, then feature"] B -->|Paywall matches| D["Fetch paywall"] D -->|Fetch fails| E["Call onError"] D -->|Gated| E D -->|Non-gated| F["Run feature on MainActor"]Reviews (2) · Last reviewed commit: "Don't send a dismissal on watchOS and tv..." · Reviewed by Greptile