-
Notifications
You must be signed in to change notification settings - Fork 0
docs: add CLAUDE.md for Claude Code guidance #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| # CLAUDE.md | ||
|
|
||
| This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. | ||
|
|
||
| ## Build & Lint | ||
|
|
||
| ```bash | ||
| # Validate podspec | ||
| pod spec lint GADManager.podspec | ||
|
|
||
| # Build via SPM | ||
| swift build | ||
|
|
||
| # CocoaPods install (in consumer projects) | ||
| pod install | ||
| ``` | ||
|
|
||
| ## Release Process | ||
|
|
||
| 1. Bump version in `GADManager.podspec` (`s.version`) | ||
| 2. Commit: `bump: release a.b.c` | ||
| 3. Tag: `git tag a.b.c && git push origin a.b.c` | ||
| 4. Push podspec: `pod trunk push GADManager.podspec` | ||
|
|
||
| ## Architecture | ||
|
|
||
| GADManager is a generic Swift library (`GADManager<E>`) that wraps Google Mobile Ads SDK with time-based throttling and lifecycle management. | ||
|
|
||
| **Core design:** | ||
| - `E` is a user-defined `RawRepresentable` enum where `RawValue == String` — each case maps to an ad unit name | ||
| - Ad unit IDs are read from `Info.plist` key `GADUnitIdentifiers` (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:** | ||
| 1. `prepare(...)` — loads the ad and caches it in `adObjects[unit]` | ||
| 2. `show(unit:force:needToWait:...)` — checks `canShow()` (time interval) and `isPrepared()` (ad validity/expiry), then calls `__show()` | ||
| 3. 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 shows | ||
| - `opeingExpireInterval`: 4 hours (5 min in DEBUG) — AppOpen ad validity window after loading | ||
| - `loadingExpirationInterval`: 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 | ||
|
|
||
| ## Distribution | ||
|
|
||
| - **CocoaPods**: `pod 'GADManager'` — depends on `Google-Mobile-Ads-SDK` (static framework) | ||
| - **SPM**: `Package.swift` — depends on `swift-package-manager-google-mobile-ads` ≥ 12.6.0 | ||
|
|
||
| ## CI | ||
|
|
||
| - **Gemini code review** (`gemini-dispatch.yml`): triggers on PR open or `@gemini` comment from OWNER/MEMBER/COLLABORATOR | ||
| - **Claude** (`claude.yml`): separate workflow for Claude-based automation | ||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this typo currently exists in the implementation in
GADManager.swift. You may want to consider refactoring the code to the correct spelling to ensure consistency and readability in the future.