Skip to content

fix(macos): stop offering remove-ads where no ads exist (#968) - #971

Merged
wei18 merged 1 commit into
mainfrom
fix/macos-submission-blockers
Jul 29, 2026
Merged

wei18 merged 1 commit into
mainfrom
fix/macos-submission-blockers

Conversation

@wei18

@wei18 wei18 commented Jul 29, 2026

Copy link
Copy Markdown
Owner

Closes #968.

Survey of macOS App Store submission blockers ahead of both apps' first Mac
submission. Base = main @ 667d65b.

Blocker 1 (most serious) — Remove Ads IAP offered where no ads exist

What I did:

  • Packages/SudokuKit/Sources/SudokuAppComposition/Live.swift and
    Packages/MinesweeperKit/Sources/MinesweeperAppComposition/Live.swift:
    makeRouteFactory now passes nil for monetizationController into
    LiveRouteFactory on macOS (#if os(iOS) picks deps.monetizationController
    / #else picks nil). SettingsView already renders the whole "Purchases"
    section (Remove Ads CTA + Restore Purchases) only when that param is
    non-nil, so this one value flip is the entire UI fix — GameAppKit's
    SettingsView.swift and GameDeps/GameConfig types are untouched.
  • Packages/AppMonetizationKit/Sources/MonetizationUI/BannerSlotView.swift:
    also fixed the Home/board banner slot dead-UI the issue asked me to check.
    NoopAdProvider (macOS — Google ships no AdMob/UMP xcframework slice for
    that SDK) always reports .suppressed, but the gate (AdGate.shouldShowBanner)
    doesn't know about platforms and still said "show a banner" — so the slot
    mounted its dismiss (✕) button and an "Advertisement" accessibility element
    over an empty rect on every macOS Home/board screen. Now body also
    collapses to EmptyView() on status == .suppressed, and
    resolveGateAndLoad() bails out (setting status = .suppressed) before
    calling onAdContext?() when the provider reports .suppressed up front.
  • That second fix also closes the NSUserTrackingUsageDescription half of
    this blocker at the CODE level, not just the Info.plist: AppTrackingTransparency
    is genuinely available on macOS 11+ (canImport is true), and the shared
    Home/board banner slot wires attPrimer.maybePresentOnAdContext() for BOTH
    apps (not Sudoku-only — that doc comment was stale). Before this fix, a real
    macOS launch would show our priming sheet and could trigger the actual
    system ATT dialog for an app with no ads/tracking behind it — worse than a
    merely-unused Info.plist string. I traced every call site
    (ATTPresenter.currentStatus()/.requestIfNeeded() are only reached
    through BannerSlotView's onAdContext hook) and confirmed this path is
    now provably unreachable on macOS. Given that, I left
    NSUserTrackingUsageDescription in the Info.plist as-is — see Blocker 2 for
    why I didn't attempt SDK-conditioning the plist itself.

Deviation from the dispatch instructions — please read: the instructions
suggested gating the render site directly in GameAppKit/SettingsView.swift
with #if os(iOS). I implemented that first, then reverted it: this exact
view is also used by SudokuUITests/ASCScreenshotEmitTests.swift
(emit_iPhone_settings) to render Sudoku's iOS App Store marketing
screenshot (docs/app-store/screenshots/sudoku/iphone-6.9/en/05-settings.png),
built purchased: true specifically so that screenshot shows the unlocked
Purchases section. That test — like every other SettingsView snapshot test
in this repo (#if canImport(AppKit)-gated) — always compiles/runs on a
macOS host. A compile-time #if os(iOS) inside SettingsView itself can't
tell "really building the macOS app" apart from "rendering iOS marketing
content on a macOS test host," so it would have silently stripped Purchases
from the iOS screenshot too. Gating the value at the two real production
composition roots (Live.swift, not the shared view) fixes production
without touching any test/screenshot call site, each of which already
controls its own monetizationController argument directly.

Consequence — no snapshot re-recording needed. Because the fix lives in
Live.swift (not SettingsView.swift), SettingsViewTests.swift /
SettingsViewWindowSnapshotTests.swift / SettingsViewAppStoreRowsTests.swift
/ ASCScreenshotEmitTests.swift all construct SettingsView directly with
their own explicit monetizationController, entirely bypassing the
composition-root gate. I ran the full SettingsView-related filter both
before and after the fix — every snapshot_iPhone_* / snapshot_iPad_* /
snapshot_mac_* baseline (SettingsViewTests.swift) passed byte-identical,
zero re-recording. This is the one place I diverged from the dispatch
brief's expectation that Mac baselines "must be re-recorded" — they don't
need to be, and forcing a re-record here would have been wrong (it would
just re-bake the current byte-identical render).

Restore Purchases reasoning: I chose to hide the entire Purchases
section on macOS, Restore Purchases included, not just the Remove Ads CTA.
Reasoning: even though this looks like a "Universal Purchase" app (both apps'
Project.swift targets use ONE bundleId across [.iPhone, .iPad, .mac]
destinations, so a Remove Ads entitlement bought on iOS may already be
recognized on Mac via the same App Store account/app record), macOS has
zero ad-gated content anywhere — hasPurchasedRemoveAds is never read
outside this one Settings section. A "Restore Purchases" button that can
never produce a visible effect (nothing on Mac ever checks the flag) is dead
UI regardless of whether the restore call itself would technically succeed,
and keeping it invites the same "why does this do nothing" review confusion
as the CTA. One if let controller = monetizationController gate covering
both rows is also simpler than splitting the section's two rows apart for a
control that would still be functionally inert either way.

Also checked, not touched: bootMonetization (MakeGameApp+Helpers.swift)
was already #if !os(iOS) return — no change needed there.

Blocker 2 — iOS-only Info.plist keys in the Mac bundle

Verified, not fixed — LSRequiresIPhoneOS is already a non-issue. I
inspected the shipped Contents/Info.plist inside the June TestFlight
archives (build/testflight/{sudoku,minesweeper}-macos.xcarchive) AND did a
fresh local xcodebuild build -destination 'platform=macOS' from this
branch: in both cases LSRequiresIPhoneOS is absent from the built
macOS bundle even though it's present in the source Info.plist (added back
in #393) — Xcode's own Info.plist processing for the macOS SDK already
strips it. Verified for both Sudoku and Minesweeper, both old archives and a
fresh build. No code change needed for the one genuinely risky key.

Investigated but left alone: UILaunchScreen / UISupportedInterfaceOrientations~ipad
/ NSUserTrackingUsageDescription.
These DO ride along in the built macOS
bundle (confirmed in the same builds) but are inert — macOS ignores UIKit
launch-screen/orientation keys, and the ATT description is now provably
unreachable at the code level (Blocker 1). I identified a genuine Apple
mechanism to SDK-condition individual Info.plist keys without splitting the
file — INFOPLIST_PREPROCESS / INFOPLIST_PREPROCESSOR_DEFINITIONS[sdk=macosx*]
(confirmed real via Xcode's own CoreBuildSystem.xcspec, it runs the plist
through the C preprocessor with per-SDK -D defines before Xcode's own
$(VAR) substitution, so it composes safely with the existing
GADApplicationIdentifier-style substitutions). I chose NOT to apply it:
both Info.plist files contain <!-- https://developer.apple.com/... -->
XML comments, and a C preprocessor treats bare // as "rest of line is a
comment" regardless of the surrounding XML comment syntax — a real
plist-corruption risk for a change whose entire payoff is removing three
inert keys. Given docs/…: "if it turns out to be genuinely impossible
without splitting the plist, say so and propose the split" — my read is it's
possible via INFOPLIST_PREPROCESS, but the risk/benefit doesn't clear the
bar for inert keys; a full plist split (two Info.plist files, two Xcode
targets) is the clean alternative but is a much bigger structural change than
three inert keys warrant. Recommend tracking as a low-priority follow-up, not
a submission blocker.

Blocker 3 — app icon name mismatch on macOS

Verified: not a bug, no change made. Inspected the built
Contents/Info.plist inside both June *-macos.xcarchive builds AND a
fresh local build: CFBundleIconName / CFBundleIconFile both resolve to
AppIcon-macOS in the shipped bundle for both apps — Xcode's asset-catalog
compiler (actool) rewrites CFBundleIconName at build time to match the
resolved ASSETCATALOG_COMPILER_APPICON_NAME[sdk=macosx*] setting,
regardless of the literal AppIcon value in the source Info.plist.
Assets.car is present. iOS side spot-checked too (CFBundleIconName =
AppIcon, correct). No submission risk here.

Blocker 4 — whatsNew build-matching collides across platforms

Fixed. mise-tasks/tf/asc_whats_new.py: find_build() now accepts a
required --platform {ios,macos} and adds
filter[preReleaseVersion.platform]=<IOS|MAC_OS> to the /builds lookup
(same platform tokens ASCRegisterKit already uses for
appStoreVersions.platform). mise-tasks/tf/upload: run_whats_new() takes
a new $6=platform arg, forwarded as --platform; both call sites
(--whats-new-only backfill loop and the post-upload auto-sync) now pass
their already-available $target_plat / $r_plat. The stale multi-match
warning in find_build() stays as defense-in-depth for a caller that omits
--platform.

Verification

  • swift build + swift test (macOS host, this machine) — AppMonetizationKit
    (122/122), GameAppKit (58/58), MinesweeperKit (371/371 full suite, exit 0).
    SudokuKit: SettingsView+CompositionTests filter green; full-suite run
    hits the pre-existing documented local segfault
    (sudokukit-full-suite-segfault-local.md) — reproduced with a DIFFERENT
    test failing each run (ToastController once, BoardLeaveOrPauseState once),
    classic parallel-execution flake, not a regression; isolated re-runs of
    each flagged suite pass cleanly.
  • xcodebuild build -destination 'generic/platform=iOS Simulator' — Sudoku
    • Minesweeper both BUILD SUCCEEDED.
  • xcodebuild build -destination 'platform=macOS' — Sudoku + Minesweeper
    both BUILD SUCCEEDED; used these fresh builds for the Blocker 2/3 Info.plist
    inspection above.
  • xcodebuild test on a real iOS Simulator (iPhone 17, OS 26.5) for
    SudokuKit-Package -only-testing:SudokuUITests (284/284) — this is what
    caught the Blocker-1 screenshot-suite problem in the first place (macOS
    swift test can't distinguish "iPhone snapshot" from "mac snapshot" once a
    real #if os(iOS) exists in the view, which is exactly why the gate had to
    move out of SettingsView.swift).
  • mise run test:ui all (iOS E2E, real simulator) — Sudoku 19/19, Minesweeper
    15/15, including test_iapPurchaseCancelFailPendingStayInPlace_N22,
    test_restoreWithNothingToRestoreShowsInfoNotSuccess, and
    test_bannerSlotRepollsOnForeground (exercises the BannerSlotView fix).
  • mise run lint:swift_strict on all 4 changed Swift files — 0 issues.
  • python3 -m py_compile + --help smoke on asc_whats_new.py; bash -n
    on mise-tasks/tf/upload. No live ASC call (would need real credentials +
    an in-flight TestFlight upload — out of scope, prepare-never-execute).

Not touched (per dispatch instructions)

mise-tasks/preflight/* and scripts/build-ascspec-screenshots.py —
concurrent work in this session.

macOS ships with no ads at all (Google has no macOS AdMob/UMP xcframework
slice, D-v2-03), but Settings still sold a "Remove Ads" IAP and a phantom
banner dismiss control could mount over empty space — a Guideline 2.1 /
3.1.1 exposure for the first Mac submission. Fixes the 4 blockers from a
pre-submission survey (#968); see the PR body for verification detail per
blocker.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@wei18
wei18 merged commit a0bb3c2 into main Jul 29, 2026
5 checks passed
@wei18
wei18 deleted the fix/macos-submission-blockers branch July 29, 2026 16:52
wei18 added a commit that referenced this pull request Jul 29, 2026
…ate (#973)

* test(sudoku): re-record stale dark-band regression baseline (#972)

`postFix_themedBackground_dailyHubDarkMode_bannerOpen_noBand` has been red
on main since #943 changed the three difficulty cards' subtitle from a
shimmer/skeleton placeholder to the resolved `Best —` empty state; nobody
re-recorded the baseline. Verified deterministic (not the timing-sensitive
flake a #971 reviewer suspected): the pixel diff bbox (64,304 → 721,662)
matches #943's change exactly and is nowhere near the banner slot.

Eyeballed the re-recorded PNG and the banner-boundary crop: no dark band or
seam, confirming #851 has not regressed — this is a stale-baseline fix, not
a determinism rework.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* test(composition): pin the macOS Settings monetization gate from #971

#971 fixed a Guideline 2.1 exposure — macOS offered "Remove Ads" where no
ads exist — by nil-ing the LOCAL `settingsMonetizationController` inside
each app's `Live.swift` `makeRouteFactory` on non-iOS platforms. Both code
reviewers and the acceptance agent on that PR flagged that nothing pins the
behaviour: the composition-level `bag.monetizationController` DI handle
stays non-nil on macOS (only the value fed into `LiveRouteFactory`'s
Settings route is gated), so the existing `liveAdProviderIsLiveOnIOSNoopOnMac`
pattern doesn't reach it, and a future refactor could silently reintroduce
the exposure. No tracking issue exists for this — it surfaced purely from
review.

Added `liveCompositionGatesSettingsMonetizationControllerByPlatform` to both
`SudokuAppCompositionTests` and `MinesweeperAppCompositionTests` (mirror
principle), reaching through the real `.live()` composition to
`routeFactory.view(for: .settings)` and asserting on the rendered
`SettingsView`'s `monetizationController` field via `String(reflecting:)` —
this exercises the actual `#if os(iOS)` gate in `Live.swift`, not a copy of
it, so deleting the gate flips the assertion. Verified by temporarily
un-gating Sudoku's `Live.swift` (passing the controller unconditionally):
the new test failed with `monetizationController: Optional(...)`; restored
the gate and the test passes again.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* test(sudoku): drop the inert async from the gate test signature (#972)

CR round 1: SudokuAppComposition.live() is synchronous, so the test never
awaited anything — and the Minesweeper mirror test was already sync. Now
symmetric.

Co-Authored-By: Claude <[email protected]>

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
wei18 added a commit that referenced this pull request Jul 30, 2026
The macOS builds are now on TestFlight, and both apps' review notes were
written for iOS only: they walk a reviewer through finding a banner, buying
Remove Ads, and answering an ATT/UMP prompt — none of which exist on macOS
(AdMob ships no macOS slice; #971 removed the purchase UI there). Telling a
reviewer to exercise a flow the build does not have wastes their time and
reads as inaccurate submission information.

Adds a PLATFORM DIFFERENCES preamble, marks the three affected sections
'iOS only', and scopes the PrivacyInfo paragraph (the manifest is shared and
describes the iOS worst case). MS also notes secondary-click flagging on Mac.
One document per app still serves both platforms.

Co-authored-by: Claude <[email protected]>
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.

fix(macos): remove-ads IAP is offered on macOS where no ads exist

1 participant