Repository navigation
feat(admob): wire real BannerView load for v2.5.2 (task #3) - #143
Merged
Merged
Conversation
Google Mobile Ads 13.x crashes early in MobileAds.shared.start() if GADApplicationIdentifier is absent from Info.plist. v2.5.2 uses Google's universal TEST App ID; v2.5.3 (user-owned) swaps to production. Co-Authored-By: Claude Opus 4.7 <[email protected]>
Replace the v2.3.4 stub with an actual AdMob 13.x banner fetch: - Construct BannerView(adSize: AdSizeBanner) on the main actor - Resolve key window's rootViewController from connected scenes (required only for click-through presentation; load succeeds without) - Bridge BannerViewDelegate's terminal callbacks into a single CheckedThrowingContinuation, single-resume-guarded against double-fire - Retain live BannerView in a UUID-keyed dict so future UIViewRepresentable plumbing (out of v2.5.2 scope) can fetch it via a UIKit-typed accessor that stays internal to AdsAdMob (foundations §9.1) - Ad unit ID: #if DEBUG pivot — test ID 2934735716 in Debug, production 3172412685 in Release. Single grep target for the v2.5.3 swap, matching the same pattern used for GADApplicationIdentifier in Info.plist. Isolation contract intact: exactly 1 `import GoogleMobileAds` directive (LiveAdMobBridge.swift). Existing 8 BannerLoadTests against the FakeAdMobBridge protocol seam unchanged and all pass. Co-Authored-By: Claude Opus 4.7 <[email protected]>
Co-Authored-By: Claude Opus 4.7 <[email protected]>
N1 — Replace #else production ad unit ID constant with a fatalError-guarded computed property (REPLACE_IN_v2.5.3). Scrub production App ID literal from App/Info.plist comment; replaced with doc-reference-only pointer to docs/v2/v2.5-readiness.md §v2.5.3. Plist value unchanged (still Google test). N3 — Wrap loadBanner() continuation in withTaskCancellationHandler. Reuses the existing OSAllocatedUnfairLock<Bool> single-resume guard on BannerLoadDelegate via a new cancel() method that routes through resumeOnce with CancellationError. A local OSAllocatedUnfairLock<BannerLoadDelegate?> holder bridges the cancel closure to the delegate constructed inside the continuation. Cancel-vs-callback races resolve via the existing hasResumed flag — no new lock introduced. N4 — Add TODO(v2.5.x) marker above the liveBanners insert site documenting the planned dispose(handle:) accessor and the intentional retain-for-handle- lifetime behavior (per impl-notes D3). Verified: swift build clean; swift test --filter BannerLoad (8/8 pass); swift test --filter AdMob (26/26 pass). Isolation audit: 1 import directive in LiveAdMobBridge.swift; 0 occurrences of production app ID across Packages/ and App/. N2 / N5 / N6 deferred. Co-Authored-By: Claude Opus 4.7 <[email protected]>
Owner
Author
CR nits applied — commit
|
wei18
added a commit
that referenced
this pull request
May 26, 2026
Round-2 CR nits from PR #143: - N2 (v2.5-readiness.md): split v2.5.3 into "Production AdMob ID paired flip" + "Submission steps" subsections; the paired flip checklist makes the asymmetric Info.plist / LiveAdMobBridge.swift swap impossible to forget. - N5 (LiveAdMobBridge.swift): replace ObjectIdentifier-filter with set.remove(_:) — BannerLoadDelegate inherits NSObject so Set uses NSObject identity hashing (hash + isEqual:) directly. Cosmetic, behaviour-identical. - N6 (plan.md + v2.5-readiness.md): tighten isolation-audit grep to '^(internal |private |public |@_implementationOnly |@preconcurrency )*import GoogleMobileAds' so it does not false-positive on doc comments mentioning the import. Also correct stale "2 檔" claims — AdMobBridge.swift is protocol-only and does not import the SDK; LiveAdMobBridge.swift is the single import site.
2 tasks
wei18
added a commit
that referenced
this pull request
May 26, 2026
… (#148) Round-2 CR nits from PR #143: - N2 (v2.5-readiness.md): split v2.5.3 into "Production AdMob ID paired flip" + "Submission steps" subsections; the paired flip checklist makes the asymmetric Info.plist / LiveAdMobBridge.swift swap impossible to forget. - N5 (LiveAdMobBridge.swift): replace ObjectIdentifier-filter with set.remove(_:) — BannerLoadDelegate inherits NSObject so Set uses NSObject identity hashing (hash + isEqual:) directly. Cosmetic, behaviour-identical. - N6 (plan.md + v2.5-readiness.md): tighten isolation-audit grep to '^(internal |private |public |@_implementationOnly |@preconcurrency )*import GoogleMobileAds' so it does not false-positive on doc comments mentioning the import. Also correct stale "2 檔" claims — AdMobBridge.swift is protocol-only and does not import the SDK; LiveAdMobBridge.swift is the single import site.
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
Implements v2.5.2 AdMob banner wiring (replaces `LiveAdMobBridge.loadBanner()` stub). Unblocks the real-device test-ad checklist in issue #132.
Changes
3 commits, +213/-6 LOC across 3 files (Info.plist + bridge + impl-notes).
Isolation contract (foundations §9.1)
`rg "^import GoogleMobileAds" Packages/` = 1 file (LiveAdMobBridge.swift only). Tighter than the documented "≤2" target.
Code Reviewer verdict: APPROVE-WITH-NITS
0 must-fix. 6 nits, ranked by significance:
CR praise
Pre-merge user-owned config (per CR §pre-merge)
Closes
Test plan
🤖 Generated with Claude Code