This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
swift build- Bump version in
Package.swift(if applicable) and update version references - Commit:
bump: release a.b.c - Tag:
git tag a.b.c && git push origin a.b.c
GADManager is a generic Swift library (GADManager<E>) that wraps Google Mobile Ads SDK with time-based throttling and lifecycle management.
Core design:
Eis a user-definedRawRepresentableenum whereRawValue == String— each case maps to an ad unit name- Ad unit IDs are read from
Info.plistkeyGADUnitIdentifiers(a[String: String]dictionary keyed by enum raw values) - The manager tracks per-unit state via dictionaries:
adObjects,intervals,isLoading,isTesting,completions, etc.
Ad lifecycle:
prepare(...)— loads the ad and caches it inadObjects[unit]show(unit:force:needToWait:...)— checkscanShow()(time interval) andisPrepared()(ad validity/expiry), then calls__show()- After dismissal (
adDidDismissFullScreenContent),reprepare()is called automatically to reload
Supported ad types: Interstitial, AppOpen (opening), Banner, Rewarded, Native
Key timing constants:
defaultInterval: 1 hour between interstitial/reward showsopeingExpireInterval: 4 hours (5 min in DEBUG) — AppOpen ad validity window after loadingloadingExpirationInterval: 1 minute
Delegate (GADManagerDelegate):
- Host app must persist and provide last-shown / last-prepared timestamps per unit
- Optional callbacks:
willPresentAD,didDismissAD
Extensions in GADManager/extensions/:
GADRequest+:hideTestLabel(),enableCollapsible(direction:)UIViewController+,UIApplication+,UIAlertAction+,String+: utilities for presenting alerts and opening settings/App Store
SPM only (CocoaPods removed — CocoaPods is deprecated):
.package(url: "https://github.com/2sem/GADManager.git", from: "1.3.8")Depends on swift-package-manager-google-mobile-ads ≥ 12.6.0.
- Gemini code review (
gemini-dispatch.yml): triggers on PR open or@geminicomment from OWNER/MEMBER/COLLABORATOR - Claude (
claude.yml): separate workflow for Claude-based automation