admob-ads
Builds and checks Pocket Arcade AdMob ads - AdsPort adapters, UMP consent, ATT prompt, spec 8.8 ad policy, banner/interstitial/rewarded slots, ADS_MODE test IDs, SKAdNetwork. Use when touching ads, consent, ATT, ad IDs or rewarded perks. Not for Premium (premium-purchase) or N3 audits.
- License 许可
- MIT
- 最近更新
- 2026-11-05
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- admob-ads
- description
- Builds and checks Pocket Arcade AdMob ads - AdsPort adapters, UMP consent, ATT prompt, spec 8.8 ad policy, banner/interstitial/rewarded slots, ADS_MODE test IDs, SKAdNetwork. Use when touching ads, consent, ATT, ad IDs or rewarded perks. Not for Premium (premium-purchase) or N3 audits.
02 资源文件 283
- 资产文件assets/admob-facts.json7.5 KB
- 资产文件assets/shared.json802 B
- 参考文档examples/ad-wiring.md8.3 KB
- 参考文档references/ad-policy.md10.9 KB
- 参考文档references/consent-flow.md28.3 KB
- 参考文档references/console-privacy-troubleshooting.md21.8 KB
- 参考文档references/placements-and-lifecycle.md14.5 KB
- 参考文档references/setup-ids-and-modes.md19.3 KB
- 脚本scripts/check-ad-behaviour.mjs48.0 KB
- 脚本scripts/check-ads.mjs52.0 KB
- 脚本scripts/check-lib.mjs44.4 KB
- 脚本scripts/lib/assemble-fixtures.mjs3.1 KB
- 脚本scripts/lib/load-ts.mjs2.6 KB
- 脚本scripts/lib/repo-scan.mjs5.6 KB
- 脚本scripts/lib/stubs/expo-constants.mjs367 B
- 脚本scripts/lib/stubs/expo-tracking-transparency.mjs1.5 KB
- 脚本scripts/lib/stubs/react-native-google-mobile-ads.mjs5.0 KB
- 脚本scripts/lib/stubs/react-native.mjs976 B
- 脚本scripts/lib/stubs/react.mjs588 B
- 脚本scripts/selftest.mjs1.5 KB
- 脚本templates/__mocks__/expo-tracking-transparency.ts1.4 KB
- 脚本templates/__mocks__/react-native-google-mobile-ads.ts3.9 KB
- 参考文档templates/packages/shell/e2e/ads-smoke/01-consent-eea.yaml2.7 KB
- 参考文档templates/packages/shell/e2e/ads-smoke/02-relaunch.yaml1.3 KB
- 参考文档templates/packages/shell/e2e/ads-smoke/03-next-interstitial.yaml1.7 KB
- 参考文档templates/packages/shell/e2e/ads-smoke/04-rewarded-continue.yaml3.1 KB
- 参考文档templates/packages/shell/e2e/ads-smoke/05-offline.yaml1.5 KB
- 参考文档templates/packages/shell/e2e/ads-smoke/06-geo-other.yaml3.7 KB
- 参考文档templates/packages/shell/e2e/subflows/close-test-ad.yaml1.6 KB
- 其他templates/packages/shell/src/app/consent-moment-context.tsx1.8 KB
- 其他templates/packages/shell/src/app/consent-moment.android.test.tsx9.7 KB
- 其他templates/packages/shell/src/app/consent-moment.test.tsx7.5 KB
- 其他templates/packages/shell/src/app/consent-moment.tsx2.1 KB
- 其他templates/packages/shell/src/app/use-ad-context.test.tsx6.8 KB
- 脚本templates/packages/shell/src/app/use-ad-context.ts6.1 KB
- 脚本templates/packages/shell/src/app/use-consent-moment.ts5.3 KB
- 脚本templates/packages/shell/src/config/ads-config.test.ts4.5 KB
- 脚本templates/packages/shell/src/config/ads-config.ts3.9 KB
- 脚本templates/packages/shell/src/config/app-variant.test.ts1.2 KB
- 脚本templates/packages/shell/src/config/app-variant.ts2.0 KB
- 脚本templates/packages/shell/src/config/skadnetwork-ids.ts1.6 KB
- 脚本templates/packages/shell/src/services/ads/ad-gate.test.ts4.4 KB
- 脚本templates/packages/shell/src/services/ads/ad-gate.ts2.7 KB
- 脚本templates/packages/shell/src/services/ads/ad-history.test.ts852 B
- 脚本templates/packages/shell/src/services/ads/ad-history.ts949 B
- 脚本templates/packages/shell/src/services/ads/ad-moments.test.ts2.1 KB
- 脚本templates/packages/shell/src/services/ads/ad-moments.ts1.5 KB
- 脚本templates/packages/shell/src/services/ads/ad-policy.test.ts4.1 KB
- 脚本templates/packages/shell/src/services/ads/ad-policy.ts2.8 KB
- 脚本templates/packages/shell/src/services/ads/admob-ads-adapter.android.test.ts7.6 KB
- 脚本templates/packages/shell/src/services/ads/admob-ads-adapter.test.ts8.2 KB
- 脚本templates/packages/shell/src/services/ads/admob-ads-adapter.ts8.2 KB
- 脚本templates/packages/shell/src/services/ads/ads-factory.test.ts1.3 KB
- 脚本templates/packages/shell/src/services/ads/ads-factory.ts1.2 KB
- 脚本templates/packages/shell/src/services/ads/ads-port.ts1.8 KB
- 脚本templates/packages/shell/src/services/ads/consent-moment-flow.test.ts14.2 KB
- 脚本templates/packages/shell/src/services/ads/consent-moment-flow.ts9.8 KB
- 脚本templates/packages/shell/src/services/ads/fake-ads.test.ts1.5 KB
- 脚本templates/packages/shell/src/services/ads/fake-ads.ts2.0 KB
- 脚本templates/packages/shell/src/services/ads/fullscreen-ad.test.ts1.2 KB
- 脚本templates/packages/shell/src/services/ads/fullscreen-ad.ts651 B
- 脚本templates/packages/shell/src/services/ads/perk-offer.test.ts3.3 KB
- 脚本templates/packages/shell/src/services/ads/perk-offer.ts2.1 KB
- 脚本templates/packages/shell/src/services/ads/read-ads-extra.test.ts2.2 KB
- 脚本templates/packages/shell/src/services/ads/read-ads-extra.ts1.5 KB
- 脚本templates/packages/shell/src/services/connectivity/connectivity-port.ts264 B
- 脚本templates/packages/shell/src/services/connectivity/expo-network-connectivity-adapter.test.ts4.0 KB
- 脚本templates/packages/shell/src/services/connectivity/expo-network-connectivity-adapter.ts1.4 KB
- 脚本templates/packages/shell/src/services/connectivity/fake-connectivity.ts936 B
- 脚本templates/packages/shell/src/services/consent/admob-consent-adapter.android.test.ts3.9 KB
- 脚本templates/packages/shell/src/services/consent/admob-consent-adapter.test.ts6.0 KB
- 脚本templates/packages/shell/src/services/consent/admob-consent-adapter.ts5.0 KB
- 脚本templates/packages/shell/src/services/consent/admob-consent-debug-adapter.test.ts1.8 KB
- 脚本templates/packages/shell/src/services/consent/admob-consent-debug-adapter.ts1.2 KB
- 脚本templates/packages/shell/src/services/consent/consent-factory.test.ts2.0 KB
- 脚本templates/packages/shell/src/services/consent/consent-factory.ts1.2 KB
- 脚本templates/packages/shell/src/services/consent/consent-port.ts1.2 KB
- 脚本templates/packages/shell/src/services/consent/fake-consent.ts1.6 KB
- 其他templates/packages/shell/src/ui/ad-banner-slot.test.tsx2.7 KB
- 其他templates/packages/shell/src/ui/ad-banner-slot.tsx1.8 KB
- 脚本templates/packages/tooling/src/ads/refresh-skadnetwork.ts2.0 KB
- 脚本tests/fixtures/base-repo/apps/demo-game/game.config.ts719 B
- 参考文档tests/fixtures/base-repo/apps/demo-game/package.json231 B
- 参考文档tests/fixtures/base-repo/package.json90 B
- 参考文档tests/fixtures/base-repo/packages/shell/package.json137 B
- 脚本tests/fixtures/base-repo/packages/shell/src/app/create-shell-parts.ts912 B
- 其他tests/fixtures/base-repo/packages/shell/src/app/shell-features.tsx401 B
- 脚本tests/fixtures/base-repo/packages/shell/src/app/test-only-entry.ts311 B
- 脚本tests/fixtures/base-repo/packages/shell/src/config/shell-plugins.ts644 B
- 脚本tests/fixtures/base-repo/packages/shell/src/config/with-shell.ts768 B
- 参考文档tests/fixtures/base-repo/packages/shell/src/i18n/catalogs/ckb.json299 B
- 参考文档tests/fixtures/base-repo/packages/shell/src/i18n/catalogs/de.json194 B
- 参考文档tests/fixtures/base-repo/packages/shell/src/i18n/catalogs/en.json166 B
- 参考文档tests/fixtures/base-repo/packages/shell/src/i18n/catalogs/fa.json298 B
- 其他tests/fixtures/base-repo/packages/shell/src/screens/home/home-screen.tsx769 B
- 其他tests/fixtures/base-repo/packages/shell/src/screens/levels/levels-screen.tsx540 B
- 脚本tests/fixtures/base-repo/packages/shell/src/screens/result/use-result-actions.ts879 B
- 其他tests/fixtures/base-repo/packages/shell/src/screens/stats/stats-screen.tsx533 B
- 脚本tests/fixtures/base-repo/packages/shell/src/screens/stats/use-stats-model.ts752 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-adapter-banner-before-init/EXPECT.txt50 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-adapter-banner-before-init/mutation.json579 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-adapter-eager-init/EXPECT.txt52 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-adapter-eager-init/mutation.json364 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-adapter-init-order/EXPECT.txt34 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-adapter-init-order/mutation.json396 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-adapter-reward-on-close/EXPECT.txt48 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-adapter-reward-on-close/mutation.json207 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-adapter-show-error-hangs/EXPECT.txt86 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-adapter-show-error-hangs/mutation.json425 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-adapter-status-loaded-flag/EXPECT.txt70 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-adapter-status-loaded-flag/mutation.json166 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-android-sample-fallback/EXPECT.txt57 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-android-sample-fallback/mutation.json334 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-att-ads-off/EXPECT.txt67 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-att-ads-off/mutation.json414 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-att-android-prepare/EXPECT.txt56 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-att-android-prepare/mutation.json200 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-att-decline-no-ads/EXPECT.txt141 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-att-decline-no-ads/mutation.json306 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-att-held-asks/EXPECT.txt77 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-att-held-asks/mutation.json399 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-att-over-level/EXPECT.txt67 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-att-over-level/mutation.json227 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-banner-any-screen/EXPECT.txt32 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-banner-any-screen/mutation.json167 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-banner-tutorial/EXPECT.txt45 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-banner-tutorial/mutation.json300 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-consent-factory-off/EXPECT.txt53 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-consent-factory-off/mutation.json262 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-consent-no-fallback/EXPECT.txt66 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-consent-no-fallback/mutation.json270 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-extra-android-reads-ios/EXPECT.txt57 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-extra-android-reads-ios/mutation.json230 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-extra-partial-units/EXPECT.txt34 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-extra-partial-units/mutation.json213 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-factory-off-requests/EXPECT.txt62 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-factory-off-requests/mutation.json220 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-first-threshold/EXPECT.txt65 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-first-threshold/mutation.json267 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-flow-allows-before-init/EXPECT.txt94 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-flow-allows-before-init/mutation.json360 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-flow-stale-facts/EXPECT.txt72 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-flow-stale-facts/mutation.json220 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-gate-init-first/EXPECT.txt40 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-gate-init-first/mutation.json272 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-gate-no-intro/EXPECT.txt40 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-gate-no-intro/mutation.json157 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-gate-preload-before-init/EXPECT.txt76 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-gate-preload-before-init/mutation.json211 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-gate-tutorial/EXPECT.txt47 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-gate-tutorial/mutation.json269 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-hard-coded-numbers/EXPECT.txt67 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-hard-coded-numbers/mutation.json193 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-history-on-unavailable/EXPECT.txt69 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-history-on-unavailable/mutation.json268 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-live-id-in-test/EXPECT.txt33 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-live-id-in-test/mutation.json212 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-missing-module/EXPECT.txt43 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-missing-module/mutation.json74 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-no-loss-break/EXPECT.txt56 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-no-loss-break/mutation.json222 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-no-resume-on-throw/EXPECT.txt65 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-no-resume-on-throw/mutation.json315 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-or-caps/EXPECT.txt51 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-or-caps/mutation.json232 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-perk-hidden-while-loading/EXPECT.txt63 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-perk-hidden-while-loading/mutation.json410 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-perk-not-loaded/EXPECT.txt51 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-perk-not-loaded/mutation.json276 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-perk-used-continue/EXPECT.txt53 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-perk-used-continue/mutation.json307 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-reward-on-dismiss/EXPECT.txt51 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-reward-on-dismiss/mutation.json194 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-variant-pair/EXPECT.txt54 B
- 参考文档tests/fixtures/check-ad-behaviour/bad-variant-pair/mutation.json186 B
- 参考文档tests/fixtures/check-ad-behaviour/good/CASE.txt59 B
- 参考文档tests/fixtures/check-ads/bad-ad-id-blocked-inline/EXPECT.txt74 B
- 参考文档tests/fixtures/check-ads/bad-ad-id-blocked-inline/mutation.json297 B
- 参考文档tests/fixtures/check-ads/bad-ad-id-blocked/EXPECT.txt74 B
- 参考文档tests/fixtures/check-ads/bad-ad-id-blocked/mutation.json512 B
- 参考文档tests/fixtures/check-ads/bad-ad-id-removed-by-plugin/EXPECT.txt65 B
- 参考文档tests/fixtures/check-ads/bad-ad-id-removed-by-plugin/mutation.json339 B
- 参考文档tests/fixtures/check-ads/bad-android-sample-fallback/EXPECT.txt85 B
- 参考文档tests/fixtures/check-ads/bad-android-sample-fallback/mutation.json334 B
- 参考文档tests/fixtures/check-ads/bad-android-units-from-ios/EXPECT.txt70 B
- 参考文档tests/fixtures/check-ads/bad-android-units-from-ios/mutation.json248 B
- 参考文档tests/fixtures/check-ads/bad-android-units-read-ios/EXPECT.txt80 B
- 参考文档tests/fixtures/check-ads/bad-android-units-read-ios/mutation.json230 B
- 参考文档tests/fixtures/check-ads/bad-att-admob-plugin-string/EXPECT.txt89 B
- 参考文档tests/fixtures/check-ads/bad-att-admob-plugin-string/mutation.json249 B
- 参考文档tests/fixtures/check-ads/bad-att-after-initialize/EXPECT.txt97 B
- 参考文档tests/fixtures/check-ads/bad-att-after-initialize/mutation.json333 B
- 参考文档tests/fixtures/check-ads/bad-att-before-form/EXPECT.txt99 B
- 参考文档tests/fixtures/check-ads/bad-att-before-form/mutation.json490 B
- 参考文档tests/fixtures/check-ads/bad-att-import-outside-adapter/EXPECT.txt139 B
- 参考文档tests/fixtures/check-ads/bad-att-import-outside-adapter/mutation.json404 B
- 参考文档tests/fixtures/check-ads/bad-att-locale-missing/EXPECT.txt105 B
- 参考文档tests/fixtures/check-ads/bad-att-locale-missing/mutation.json136 B
- 参考文档tests/fixtures/check-ads/bad-att-on-android/EXPECT.txt86 B
- 参考文档tests/fixtures/check-ads/bad-att-on-android/mutation.json200 B
- 参考文档tests/fixtures/check-ads/bad-att-plugin-missing/EXPECT.txt124 B
- 参考文档tests/fixtures/check-ads/bad-att-plugin-missing/mutation.json232 B
- 参考文档tests/fixtures/check-ads/bad-banner-model-no-policy/EXPECT.txt133 B
- 参考文档tests/fixtures/check-ads/bad-banner-model-no-policy/mutation.json241 B
- 参考文档tests/fixtures/check-ads/bad-banner-on-result/EXPECT.txt73 B
- 参考文档tests/fixtures/check-ads/bad-banner-on-result/mutation.json492 B
- 参考文档tests/fixtures/check-ads/bad-banner-slot-hook-no-policy/EXPECT.txt136 B
- 参考文档tests/fixtures/check-ads/bad-banner-slot-hook-no-policy/mutation.json257 B
- 参考文档tests/fixtures/check-ads/bad-banner-slot-no-moment/EXPECT.txt81 B
- 参考文档tests/fixtures/check-ads/bad-banner-slot-no-moment/mutation.json385 B
- 参考文档tests/fixtures/check-ads/bad-banner-testid/EXPECT.txt33 B
- 参考文档tests/fixtures/check-ads/bad-banner-testid/mutation.json190 B
- 参考文档tests/fixtures/check-ads/bad-child-tag/EXPECT.txt46 B
- 参考文档tests/fixtures/check-ads/bad-child-tag/mutation.json259 B
- 参考文档tests/fixtures/check-ads/bad-consent-adapter-direct/EXPECT.txt112 B
- 参考文档tests/fixtures/check-ads/bad-consent-adapter-direct/mutation.json390 B
- 参考文档tests/fixtures/check-ads/bad-consent-moment-unmounted/EXPECT.txt74 B
- 参考文档tests/fixtures/check-ads/bad-consent-moment-unmounted/mutation.json319 B
- 参考文档tests/fixtures/check-ads/bad-debug-geography-store-path/EXPECT.txt131 B
- 参考文档tests/fixtures/check-ads/bad-debug-geography-store-path/mutation.json330 B
- 参考文档tests/fixtures/check-ads/bad-debug-import/EXPECT.txt71 B
- 参考文档tests/fixtures/check-ads/bad-debug-import/mutation.json373 B
- 参考文档tests/fixtures/check-ads/bad-deprecated-size/EXPECT.txt78 B
- 参考文档tests/fixtures/check-ads/bad-deprecated-size/mutation.json220 B
- 参考文档tests/fixtures/check-ads/bad-error-code/EXPECT.txt73 B
- 参考文档tests/fixtures/check-ads/bad-error-code/mutation.json224 B
- 参考文档tests/fixtures/check-ads/bad-free-hints-ignored/EXPECT.txt109 B
- 参考文档tests/fixtures/check-ads/bad-free-hints-ignored/mutation.json504 B
- 参考文档tests/fixtures/check-ads/bad-hint-perk-by-hand/EXPECT.txt68 B
- 参考文档tests/fixtures/check-ads/bad-hint-perk-by-hand/mutation.json499 B
- 参考文档tests/fixtures/check-ads/bad-hooks-api/EXPECT.txt28 B
- 参考文档tests/fixtures/check-ads/bad-hooks-api/mutation.json266 B
- 参考文档tests/fixtures/check-ads/bad-import-in-screen/EXPECT.txt63 B
- 参考文档tests/fixtures/check-ads/bad-import-in-screen/mutation.json323 B
- 参考文档tests/fixtures/check-ads/bad-impure-policy/EXPECT.txt59 B
- 参考文档tests/fixtures/check-ads/bad-impure-policy/mutation.json237 B
- 参考文档tests/fixtures/check-ads/bad-interstitial-in-effect/EXPECT.txt71 B
- 参考文档tests/fixtures/check-ads/bad-interstitial-in-effect/mutation.json316 B
- 参考文档tests/fixtures/check-ads/bad-level-end-no-record/EXPECT.txt81 B
- 参考文档tests/fixtures/check-ads/bad-level-end-no-record/mutation.json248 B
- 参考文档tests/fixtures/check-ads/bad-level-end-not-recorded/EXPECT.txt102 B
- 参考文档tests/fixtures/check-ads/bad-level-end-not-recorded/mutation.json169 B
- 参考文档tests/fixtures/check-ads/bad-missing-fake/EXPECT.txt37 B
- 参考文档tests/fixtures/check-ads/bad-missing-fake/mutation.json90 B
- 参考文档tests/fixtures/check-ads/bad-mock-size/EXPECT.txt12 B
- 参考文档tests/fixtures/check-ads/bad-mock-size/mutation.json200 B
- 参考文档tests/fixtures/check-ads/bad-no-pg/EXPECT.txt39 B
- 参考文档tests/fixtures/check-ads/bad-no-pg/mutation.json187 B
- 参考文档tests/fixtures/check-ads/bad-no-plugin/EXPECT.txt15 B
- 参考文档tests/fixtures/check-ads/bad-no-plugin/mutation.json222 B
- 参考文档tests/fixtures/check-ads/bad-no-units-extra/EXPECT.txt84 B
- 参考文档tests/fixtures/check-ads/bad-no-units-extra/mutation.json332 B
- 参考文档tests/fixtures/check-ads/bad-not-yet-due/EXPECT.txt600 B
- 参考文档tests/fixtures/check-ads/bad-not-yet-due/mutation.json429 B
- 参考文档tests/fixtures/check-ads/bad-plugin-literal/EXPECT.txt31 B
- 参考文档tests/fixtures/check-ads/bad-plugin-literal/mutation.json313 B
- 参考文档tests/fixtures/check-ads/bad-policy-numbers/EXPECT.txt51 B
- 参考文档tests/fixtures/check-ads/bad-policy-numbers/mutation.json184 B
- 参考文档tests/fixtures/check-ads/bad-prepare-ads-direct/EXPECT.txt117 B
- 参考文档tests/fixtures/check-ads/bad-prepare-ads-direct/mutation.json481 B
- 参考文档tests/fixtures/check-ads/bad-real-id-in-code/EXPECT.txt63 B
- 参考文档tests/fixtures/check-ads/bad-real-id-in-code/mutation.json442 B
- 参考文档tests/fixtures/check-ads/bad-reset-in-store-path/EXPECT.txt77 B
- 参考文档tests/fixtures/check-ads/bad-reset-in-store-path/mutation.json267 B
- 参考文档tests/fixtures/check-ads/bad-reward-on-close/EXPECT.txt19 B
- 参考文档tests/fixtures/check-ads/bad-reward-on-close/mutation.json261 B
- 参考文档tests/fixtures/check-ads/bad-rewarded-loaded-flag/EXPECT.txt102 B
- 参考文档tests/fixtures/check-ads/bad-rewarded-loaded-flag/mutation.json222 B
- 参考文档tests/fixtures/check-ads/bad-sample-in-game-config/EXPECT.txt48 B
- 参考文档tests/fixtures/check-ads/bad-sample-in-game-config/mutation.json211 B
- 参考文档tests/fixtures/check-ads/bad-sdk-caret/EXPECT.txt38 B
- 参考文档tests/fixtures/check-ads/bad-sdk-caret/mutation.json192 B
- 参考文档tests/fixtures/check-ads/bad-skadnetwork-suffix/EXPECT.txt64 B
- 参考文档tests/fixtures/check-ads/bad-skadnetwork-suffix/mutation.json148 B
- 参考文档tests/fixtures/check-ads/bad-typed-test-id/EXPECT.txt56 B
- 参考文档tests/fixtures/check-ads/bad-typed-test-id/mutation.json312 B
- 参考文档tests/fixtures/check-ads/bad-units-always-in-extra/EXPECT.txt89 B
- 参考文档tests/fixtures/check-ads/bad-units-always-in-extra/mutation.json189 B
- 参考文档tests/fixtures/check-ads/good/CASE.txt59 B
- 参考文档tests/fixtures/check-ads/pass-blocked-without-ad-id/EXPECT.txt13 B
- 参考文档tests/fixtures/check-ads/pass-blocked-without-ad-id/mutation.json508 B
- 参考文档tests/fixtures/check-ads/pass-debug-tools-type-import/EXPECT.txt13 B
- 参考文档tests/fixtures/check-ads/pass-debug-tools-type-import/mutation.json463 B
03 SKILL.md 正文
AdMob ads and consent
Makes every game show Google AdMob ads that never interrupt play: consent and Apple's tracking prompt come first, every "may an ad appear now?" answer comes from pure, tested functions, test builds only ever see Google's test ads, and two scripts prove it on the real code.
Rules that must hold
- Ads never interrupt play (spec N8, 8.8). No ad during a level, the tutorial or app start; banners only at the bottom of Home, Levels and Statistics; interstitials only after the player taps Next / Replay / Try again on the Result screen; rewarded ads only when the player taps "Watch an ad to ...". Why: this is the product's promise; everything else in this skill serves it.
- Every ad decision comes from
ad-policy.ts/perk-offer.ts(pure, numbers fromgame.config.ts, facts from the Premium store, ConnectivityPort, ConsentPort and the savedAdHistory). No ad logic in screens or adapters, no hard-coded caps; the free hints come fromgame.config.tshints.freePerDaythroughuseHintPerk(today). Every finished level is counted in the history in the one run-end update (extendRunEnd: recordAdLevelEndin the composition root). Why: only pure rules can be tested one by one, the spec makes the numbers per-game configuration, and a history that never counts a level allows exactly one interstitial ever. - Consent, then Apple's tracking prompt, before any ad request, through the Shell's consent moment, and none at all when ads are off. Refresh consent info at every launch (not Premium, ads enabled); where Google's form is required show S3 (
ConsentIntroScreen) first and the form only after Continue, and nowhere else: where no form is due, Apple's system prompt appears on its own with the app's usage text (lead decision L10, proven bycheck-ad-behaviour's case "prepareAds where consent is not required"); oncecanRequestAdsis true ask App Tracking Transparency throughConsentPort.requestTracking()(only while not-determined, the app active); thensetRequestConfiguration+initializeand load ads. All of it after the tutorial, online, not Premium, over a banner screen (never over a level), before the first ad.ConsentMoment(mounted inShellFeatures) is the only runner ofprepareAds. Build the ConsentPort only withcreateConsentPort(adsMode, ...), so anADS_MODE=offbuild never calls UMP or ATT. Android: Google's form only, never a tracking prompt:requestTracking()answers'unavailable'off iOS before it touchesexpo-tracking-transparencyor waits for the app to be active (L14;check-adsruleno-att-android), and L10 holds (S3 only right before Google's form). Why: Google requires consent (EEA/UK/CH), the spec puts the Shell's S3 moment before Google's form, Apple requires the ATT answer before an ad request can use the IDFA (owner decision O1, guideline 5.1.2(i)), the SDK may preload at initialisation, and a UMP info update is a network request that would fail the E2E network audit ofoffbuilds. - Test builds never see real ads; real IDs reach the runtime only in
store+livebuilds.ADS_MODEdecides:test-> Google's sample app ID +TestIds,live-> the game's IDs viaexpo.extra.adUnits,off-> nothing. IDs live only inapps/<game>/game.config.ts; app code never types an ad ID. Android: the same per platform:test/offget Google's Android sample app id,livegetsads.ids.android, and a live build without Android ids gets no Android app id at all, never the sample (owner step GP5;android-ids); the live units are embedded per platform and read forPlatform.OS, so Android never shows the iOS units (android-units). Why: spec 8.8; real ads in a test build risk the owner's AdMob account. react-native-google-mobile-adsis exactly 17.2.0 and is imported only byadmob-ads-adapter.ts,admob-consent-adapter.tsand the test-onlyadmob-consent-debug-adapter.ts, with the classic create/load/show API (no v17 hooks or pools). Why: an upgrade then touches three files, and caps stay in pure code.- The reward is granted only on
RewardedAdEventType.EARNED_REWARD, and the AdsPort reports aRewardedStatus('loading' | 'ready' | 'unavailable'), never a loaded flag.perkOffergives a continue'loading'while its ad loads (S7 draws it busy) and'hidden'only when no ad can come; hints never wait. So a hidden continue always means unavailable, and a lost run nobody can rescue ends at once (lead decision L11, game-host-integration'sisLossStranded). Why: spec 8.8 "the reward is given only when the ad completes" and "hidden, not broken", and round 4's flag stranded finished runs (an endless run in an ads-off build never showed its result). - Pause the game loop and audio around every fullscreen ad (
runFullscreenAd), resuming infinally, and make every show settle. The adapter resolves onCLOSED, onERRORand on a rejectedshow(): a failed presentation sendsERROR(phaseshow) and neverCLOSED, aftershow()has already resolved. Android: the ad starts its own Activity, so AppState leavesactivewhile it shows;runFullscreenAdstill suspends and resumes itself, and the game comes back to the same run. Why: iOS does not background the app for these ads, so nothing else pauses the game, and a show that never settles leaves the game suspended and the Next button dead. - Ads are silent. Never an error, a spinner or "please connect" for ads; failures go to the ErrorLogPort; branch on
error.phase, thenerror.reason, never the deprecatederror.code. The banner slot has zero height until an ad has loaded. Why: spec 4.1 and S4 (no empty box). - General audience, and Apple's rules for tracking:
maxAdContentRating: PG, no child-directed or under-age tags.expo-tracking-transparency57.0.2 is imported only byadmob-consent-adapter.ts; its plugin entry gets the en text ofconsent.tracking.usage-descriptionandwithShellwrites it for en, de, fa and ckb; the AdMob plugin gets nouserTrackingUsageDescription, and the AdMob console publishes no IDFA explainer (step A3). A declined, restricted or unavailable answer still serves ads, without the IDFA, and nothing is gated on it. Android: no ATT and no SKAdNetwork; the advertising-id permissioncom.google.android.gms.permission.AD_ID(declared by the SDK and the tracking plugin) is never blocked or stripped (ad-id-permission). Why: decision D8 and owner decision O1 (2026-09-30, reversing the old "no ATT prompt in v1"): guideline 5.1.2(i) asks for explicit permission through the ATT APIs and forbids gating anything on it. - The SKAdNetwork list is Google's full list of
xxxxxxxxxx.skadnetworkidentifiers, refreshed before every release. Why: the plugin only copies what it gets; Google changes the list. - Consent reset, the debug geography and the Ad Inspector exist only in test builds, behind the Shell's test-only entry: the geography (
debugGeography: 'eea' | 'other',testDeviceIdentifiers) reaches the consent adapter only throughdebugServices.setConsentGeography, which the debug link'sgeo=calls (check-adsruledebug-geography-test-only). Why: they change consent behaviour for real players. - The owner does the AdMob console steps (A1-A5); ask and wait, never invent IDs or publish anything yourself. On Android the owner also makes the AdMob Android app and its three units (GP5). Why: the console belongs to the owner's account, and an invented ID or a published setting would reach real players and risk that account.
Workflow
- Read references/setup-ids-and-modes.md. Install the SDK exactly (
npm install -E react-native-google-mobile-ads@17.2.0in every app) plusexpo-network,expo-constantsandexpo-tracking-transparency(~57.0.2, the Expo table spec; a*peer in the Shell and a root override, planned with the dependency-management skill) vianpx expo install. - Copy the templates into the repo at the same relative paths (keep an existing
app-variant.ts;ads-config.tsreplaces the bootstrap version):templates/packages/shell/src/config/,templates/packages/shell/src/services/{ads,consent,connectivity}/,templates/packages/shell/src/ui/ad-banner-slot.tsx(+ test),templates/packages/tooling/src/ads/refresh-skadnetwork.ts,templates/__mocks__/react-native-google-mobile-ads.tsandtemplates/__mocks__/expo-tracking-transparency.ts. Do not rewrite them from memory. - Check that the Shell's one plugin list,
shellPlugins(game, adsMode)inpackages/shell/src/config/shell-plugins.ts(architecture-and-boundaries;with-shell.tsspreads it), holds the lines['react-native-google-mobile-ads', admobPluginOptions(adsMode, game.ads.ids, SKADNETWORK_IDS)]and['expo-tracking-transparency', { userTrackingPermission: TRACKING_USAGE_DESCRIPTIONS.en }], and thatwithShell's locales writeNSUserTrackingUsageDescriptionfor the four languages (the templates already do; add exactly those lines if a copy lacks them), whereadsMode = game.ads.isEnabled ? variant.adsMode : 'off', and make itsextraholdadsModeplus...(adUnits === null ? {} : { adUnits })withadUnits = adUnitsExtra(adsMode, game.ads.ids)(the live units per platform,{ ios, android }); fill theadssection of everyapps/<game>/game.config.ts(policy 3 / 180_000 / 2; the owner's IDs or documented-format placeholders). Runnpx expo prebuild --platform ios --cleanafter plugin changes. - Read references/consent-flow.md (with "App Tracking Transparency" and its sources). Create the ports once with
createAdsPort(readAdsExtra(), ...)andcreateConsentPort(readAdsExtra().adsMode, ...); feedisAdsEnabled = extra.game.adPolicy.isAdsEnabled && adsMode !== 'off'into the gate input and the policy config. With the composition root (Shell step 7) copy the consent moment:templates/packages/shell/src/app/consent-moment.tsx,consent-moment-context.tsxanduse-consent-moment.ts(+consent-moment.test.tsx; the flowservices/ads/consent-moment-flow.tscame with step 2), and check thatShellFeaturesrenders<ConsentMoment isHeld={parts.isConsentMomentHeld} debug={debug.services}>around the navigator (game-host-integration's template does). It refreshes consent once per launch and runsprepareAds(S3 intro, then Google's form, then Apple's ATT prompt) the first time a banner screen is open; never call the gate orrequestTrackingby hand. It needs toybox-screens'screens/consent/consent-intro-screen.tsx(part of the Shell core in every slice). Show the "Ad privacy choices" row only when required. - Read references/ad-policy.md and references/placements-and-lifecycle.md. Copy
templates/packages/shell/src/app/use-ad-context.ts(+ test) at Shell step 7, with the composition root (it reads the services context, the debug services and the game extra, which exist from then on):useAdContext(placement)gathers the liveAdContext(Premium store,useIsOnline(), the consent moment's live answer, else the savedsave.doc().ads.consent.canRequestAds, tutorial done, levels won),useAdPolicyConfig(placement)the game's numbers (off inADS_MODE=offbuilds),useHintPerk(today)the hint perk with the game'shints.freePerDay, anduseBannerSlot('home' | 'levels' | 'stats')the banner model the screens' model hooks return (it also asks the consent moment for the ad moment while the screen is open); the parity harness of test builds opens a placement throughForcedAdPlacementsContext. PutAdBannerSlotat the bottom of Home, Levels and Statistics withisAllowedfromuseBannerSlot('<screen>')(in the screen's model hook, never built by hand) and the Toybox banner band asloadedStyle; callshowInterstitialIfDueonly in the Next / Replay / Try again handlers and save the returned history; render hint and continue buttons fromperkOfferand run the perk only whenearnRewardedPerkreturnstrue; giverunFullscreenAdthe game lifecycle. examples/ad-wiring.md shows each call in place. - Run the Jest suites:
npx jest packages/shell/src/services/ads packages/shell/src/services/consent packages/shell/src/config packages/shell/src/ui/ad-banner-slot.test.tsx packages/shell/src/app/use-ad-context.test.tsx packages/shell/src/app/consent-moment.test.tsx --ci --selectProjects unit --coverage --collectCoverageFrom='packages/shell/src/services/ads/**/*.ts' --coverageThreshold='{}'(paths first; onlynpm run test:coveragejudges the thresholds). - Run
node ${CLAUDE_SKILL_DIR}/scripts/check-ads.mjs .andnode ${CLAUDE_SKILL_DIR}/scripts/check-ad-behaviour.mjs .. Fix everyFAILline (each names the file, the rule and the fix) and rerun until both printRESULT: PASS. Rules whose target a later Shell build step creates printSKIPlines until it exists (a pass):plugin-entryandatt-pluginuntilpackages/shell/src/config/shell-plugins.ts(step 8),level-end-recordeduntilpackages/shell/src/app/create-shell-parts.tsandconsent-momentuntilpackages/shell/src/app/shell-features.tsx(step 7). The Android rules (android-ids,android-units,ad-id-permission,no-att-android) apply at once: iOS builds are unaffected by them, and an Android port is not done until they pass. - Before a release:
node packages/tooling/src/ads/refresh-skadnetwork.ts --check, then the ads smoke test, by hand on anADS_MODE=testbuild: the Maestro flowstemplates/packages/shell/e2e/ads-smoke/01to06(pocket-arcade-index copies them at Shell step 10, with e2e-maestro's flows and itsdebug-setup.yaml), each run astools/maestro/bin/maestro --device <udid> --driver-host-port <port> test -e APP_ID=<bundle id> -e APP_SCHEME=<scheme> packages/shell/e2e/ads-smoke/<flow>.yamlafter a fresh install started withxcrun simctl launch <udid> <bundle id>(Maestro'slaunchAppgrants the ATT answer), never throughe2e:ios. They covergeo=eea(S3, the form, the ATT prompt declined, a banner), a relaunch, Next with an interstitial, the rewarded continue with its board assertion (game.board-framesettled for the continue's seq), offline, andgeo=other(references/console-privacy-troubleshooting.md, "Simulator smoke test"). Then hand off for the privacy-manifest and network audits (App Privacy: Device ID used for tracking by the Google Mobile Ads SDK; the app's own manifest keepsNSPrivacyTrackingfalse). - Tell the owner, in plain words, which console steps are still open (A1-A4 before the first store build, A5 after the first release; GP5, the AdMob Android app and its three units, before the first live Android build) and what each one needs from them.
- On Android: copy the three Android tests with the other templates,
admob-consent-adapter.android.test.ts,admob-ads-adapter.android.test.tsandconsent-moment.android.test.tsx(they run in theunit-androidJest project), and run the ads smoke flows on anADS_MODE=testemulator build after a fresh install started withadb -s <serial> shell am start -W -n <package>/.MainActivity(references/console-privacy-troubleshooting.md, "On the Android emulator"); the tracking steps run only on iOS.
Definition of done
- [ ] The SDK is exactly 17.2.0 in every app and imported only by the three adapter files;
expo-tracking-transparency~57.0.2is in every app and imported only byadmob-consent-adapter.ts; both root mocks exist. - [ ] Every template file is in place and its Jest suite passes (ad policy, perk offer, ad history, ad gate, ad moments, ads adapter, ads factory, read-ads-extra, ads config, app variant, consent adapter, consent factory, banner slot).
- [ ] The plugin gets
admobPluginOptions(...);expo.extra.adUnitsexists only instore+livebuilds; no ad ID is typed in app code. - [ ] Consent: launch refresh, S3 (
ConsentMomentinShellFeatures) then Google's form, then Apple's ATT prompt (while not-determined), after the tutorial, over a banner screen and before the first ad; nothing initialised or loaded withoutcanRequestAds; the moment publishescanRequestAds: trueonly after the ATT answer and a finishedinitialize, and the adapter's banner mounts its native view only afterinitialize; declined, restricted or unavailable tracking still initializes; the S3 parity frame holds the moment without asking Google or Apple; the privacy row appears only when required; the ConsentPort comes fromcreateConsentPort, soADS_MODE=offnever calls UMP or ATT. - [ ] The ATT text: the plugin entry with the en text,
NSUserTrackingUsageDescriptioninwithShell's locales for en, de, fa and ckb fromconsent.tracking.usage-description(fa and ckb listed for the owner's own review, never blocking); no IDFA explainer in the AdMob console. - [ ] Every finished level counts in the ad history in the one run-end update (
extendRunEnd: recordAdLevelEnd), and the free hints followhints.freePerDay(useHintPerk). - [ ] Banners only on
home.banner-ad,levels.banner-ad,stats.banner-ad, each flag computed byshouldShowBannerand the loaded slot drawn as the Toybox band; interstitials only from Result-screen handlers; perks only on the player's tap, rewarded only onEARNED_REWARD; the game is suspended during fullscreen ads. - [ ] Offline, Premium, no consent and
ADS_MODE=offeach show no ad and no message. - [ ]
refresh-skadnetwork.ts --checkpasses before a release; the ads-smoke flows 1 to 6 passed on anADS_MODE=testbuild, each after a fresh install started withxcrun simctl launch(S3, form, ATT declined, banner; relaunch without prompts; the interstitial; the rewarded continue with the board settled; offline;geo=other); the owner has done A1-A4 for this game (A5 after release). - [ ] Android: a live build gets the game's Android ids or no Android app id at all (never Google's sample), the live units per platform, no tracking prompt (
requestTrackinganswers'unavailable'), andAD_IDis never blocked;admob-consent-adapter.android.test.ts,admob-ads-adapter.android.test.tsandconsent-moment.android.test.tsxpass inunit-android. - [ ] L11: the AdsPort, the adapter, the factory's off port and the fake report
rewardedStatus/subscribeRewardedStatus;perk-offer.test.tscovers the loading row; nothing usesisRewardedLoaded. - [ ]
node ${CLAUDE_SKILL_DIR}/scripts/check-ads.mjs .andnode ${CLAUDE_SKILL_DIR}/scripts/check-ad-behaviour.mjs .both printRESULT: PASS
Anti-patterns
- Calling
showInterstitialIfDuefrom a Result-screen effect. The ad would cover the result. Only the button handlers call it. - "Upgrading" the adapter to
useInterstitialAd,useRewardedAdor ad pools. Hooks tie ads to component lifetime and pools start preloading (and on Android initialise the SDK) before consent. Keep the classic API. - Initialising the SDK at app start "to be ready". It may preload ads before consent.
prepareAdsis the only caller ofinitialize. - Typing test unit IDs or the sample publisher ID in code. Use
TestIds.*in the adapter andGOOGLE_SAMPLE_APP_IDSinads-config.ts; whether an id is one of Google's sample ids isisGoogleSampleAdId, the one answer live builds and the release gates share. npx expo install react-native-google-mobile-ads. It writes^17.2.0; usenpm install -E.- A
.skadnetwork-less SKAdNetwork list, or one edited by hand. Regenerate with the refresh script. - Hiding an ad failure behind a message, a retry button or a spinner. Ads are silent; log and move on.
- Granting a reward on
CLOSED, or showing a pressable "Watch an ad" button with nothing loaded. - Hiding a continue while its rewarded ad is still loading. "Hidden" then means two things and a lost run waits for nobody; offer it busy (
'loading') and keep'hidden'for "no ad can come". - Putting
ads=testin an ads-smoke setup link. It is S15's "Always show test ads" (no pacing), kept across launches; the interstitial step then proves nothing. - Changing one game's caps by editing
ad-policy.ts. Change the numbers in that game'sgame.config.ts; they may be raised above the spec floors (3 levels, 180 000 ms, 2 levels), never lowered. - Putting
AdsConsent.reset()or the Ad Inspector in the consent adapter. They belong to the test-only debug adapter. - Calling
createAdmobConsentAdapterdirectly, or takingisAdsEnabledfrom the game config alone. AnADS_MODE=offbuild (screenshots, E2E) then asks Google UMP at launch and the runtime network audit fails; usecreateConsentPort(adsMode, ...)andisAdsEnabled && adsMode !== 'off'. - Wrapping
AdBannerSlotin a band that renders nothing until an ad has loaded. The native banner must be mounted to load; pass the band asloadedStyle. - Asking ATT at launch, before Google's form, or from a screen. Apple's prompt comes through
ConsentPort.requestTracking()insideprepareAds, after the form and beforeinitialize, over a banner screen only. - Hiding ads, a perk or Premium behind "Allow". Declined tracking serves the same ads without the IDFA; guideline 5.1.2(i) forbids gating anything on the answer.
- Publishing an IDFA explainer in the AdMob console or setting the AdMob plugin's
userTrackingUsageDescription. UMP would run a second ATT flow, and the text would have two writers. - Proving ATT with a flow that starts with
launchApp. Maestro grants every permission by default, so the status reads authorized and the prompt never shows; launch withxcrun simctl launch <udid> <bundleId>. - Fixing a failing checker by weakening a Jest test or the fixture. The behaviour check runs the real modules; fix the module.
Files in this skill
| File | What it is | Read/run when |
|---|---|---|
| references/setup-ids-and-modes.md | Versions, install, the APP_VARIANT x ADS_MODE matrix, IDs, plugin options, test IDs, SKAdNetwork refresh, re-verify | Workflow steps 1-3 |
| references/consent-flow.md | UMP rules, App Tracking Transparency (owner decision O1, how Expo reports restricted, the sources checked 2026-09-30), ConsentPort, the consent -> ATT -> initialize -> preload sequence, the privacy row, test-only tools | Workflow step 4 |
| references/ad-policy.md | Spec 8.8/8.10 rules, the pure policy, ad history, perk offers, pinned interpretations, tests | Workflow step 5, before changing any ad rule |
| references/placements-and-lifecycle.md | AdsPort and adapter facts, banner slot, Result-screen flow, rewarded perks, pausing, offline table | Workflow step 5 |
| references/console-privacy-troubleshooting.md | AdMob console steps A1-A6 (no IDFA explainer), privacy facts (Device ID used for tracking by the ads SDK, the app's manifest without tracking), the simulator smoke test with ATT and the rewarded continue and its recorded run, root mocks, error and symptom tables | Workflow steps 8-9, and when an ad misbehaves |
| examples/ad-wiring.md | The whole wiring for the pilot game, call by call | Workflow step 5, as the model |
templates/packages/shell/src/config/ |
ads-config.ts (+ test; GOOGLE_SAMPLE_PUBLISHER and isGoogleSampleAdId, which the release tooling imports), app-variant.ts (+ test; both synced from the library, do not edit here), skadnetwork-ids.ts (Google's 50 IDs, 2026-09-26) |
Workflow steps 2-3 |
templates/packages/shell/src/services/ads/ |
Port, AdMob adapter (+ test, and admob-ads-adapter.android.test.ts for the unit-android project: Google's Android test units, the game's units in live, fullscreen ads that settle, the reward only on EARNED_REWARD), fake, factory, read-ads-extra, policy, history, perk offer, gate (with the S3 intro step), the consent moment flow, fullscreen lifecycle, moments, with tests |
Workflow step 2 |
templates/packages/shell/src/services/consent/ |
ConsentPort (with TrackingStatus and requestTracking), AdMob consent adapter with the ATT request (+ test; the test is synced from the library, the same file as unit-and-component-tests' example: do not edit here), consent factory createConsentPort (+ test), test-only debug adapter (+ test), fake (scripted ATT status, prompt count), and admob-consent-adapter.android.test.ts (the unit-android project: no tracking step, UMP as on iOS) |
Workflow step 2 |
templates/packages/shell/src/services/connectivity/ |
ConnectivityPort, expo-network adapter, fake | Workflow step 2 |
templates/packages/shell/src/ui/ |
ad-banner-slot.tsx (collapsed until loaded, loadedStyle for the band) and its test |
Workflow step 2 |
templates/packages/shell/src/app/ |
use-ad-context.ts (useAdContext, useAdPolicyConfig, useHintPerk, useBannerSlot, ForcedAdPlacementsContext) and its test; the consent moment consent-moment.tsx (+ test, and consent-moment.android.test.tsx for the unit-android project: S3 then Google's form then initialize, no tracking step), consent-moment-context.tsx and use-consent-moment.ts; they import toybox-screens' use-is-online.ts, use-game-extra.ts and consent-intro-screen.tsx |
Workflow steps 4 and 5 |
templates/packages/tooling/src/ads/refresh-skadnetwork.ts |
Regenerates or --checks the SKAdNetwork list from Google's page |
Workflow step 8 |
templates/packages/shell/e2e/ads-smoke/ |
The ads smoke test as six Maestro flows (tag ads-smoke, run by hand on an ADS_MODE=test build, never by e2e:ios): 01-consent-eea.yaml, 02-relaunch.yaml, 03-next-interstitial.yaml, 04-rewarded-continue.yaml (the board assertion), 05-offline.yaml, 06-geo-other.yaml; the tracking-prompt steps run only when: platform: iOS, and flow 6 has an Android branch |
Workflow steps 8 and 10 |
templates/packages/shell/e2e/subflows/close-test-ad.yaml |
Closes Google's full-screen test ad at the close key's point POINT (03 and 04; they also use e2e-maestro's win-and-next.yaml) |
Workflow step 8 |
templates/__mocks__/react-native-google-mobile-ads.ts |
Jest root mock of the SDK surface the adapters use (synced from the library) | Workflow step 2 |
templates/__mocks__/expo-tracking-transparency.ts |
Jest root mock of the tracking module (jest-expo mocks only its native module): undetermined, then denied when asked (synced from the library) |
Workflow step 2 |
assets/admob-facts.json |
Pinned version, adapter import allowlists, the tracking facts (package, adapter, allowed names, plugin, catalog key, languages), banned SDK names, ID patterns, policy floors, banner slots, required files | Read by the checkers; update on an SDK upgrade |
scripts/check-ads.mjs |
Static checks: files, pin, imports, SDK API, consent only through createConsentPort, the debug geography only in test-only code (debug-geography-test-only), the rewarded status instead of a loaded flag (rewarded-status), IDs, ATT (att-adapter-only, att-order: after the form and the canRequestAds check, before initialize; att-plugin: the plugin entry, the four texts and the package, due at Shell step 8), plugin entry (due at Shell step 8), extra.adUnits only through adUnitsExtra, SKAdNetwork, policy floors, banner placement and its shouldShowBanner flag, ads in effects, the level end in the ad history and the consent moment (due at step 7), the free hints from the config; Android: android-ids (no sample app id in a live build), android-units (units per platform), ad-id-permission, no-att-android (the first two run the repo's ads-config.ts and read-ads-extra.ts) |
Workflow step 7 |
scripts/check-ad-behaviour.mjs |
Runs the repo's own ad modules (type stripping) against the spec 8.8 decision table and the consent -> ATT -> initialize order (declined, restricted and unavailable still initialize; nothing with ads off, for Premium, offline, before the tutorial or while held; ATT only over a banner screen), and the two adapters (the ATT request included), both factories and read-ads-extra against scripted stand-ins | Workflow step 7 |
scripts/lib/repo-scan.mjs |
File listing and import parsing helpers for the checkers | Read only to change a checker |
scripts/lib/load-ts.mjs |
Imports repo TypeScript modules with the @e07/* workspace aliases and the module stand-ins |
Read only to change a checker |
scripts/lib/stubs/ |
Scripted Node stand-ins for react-native-google-mobile-ads 17.2.0, expo-tracking-transparency 57.0.2, react-native (Platform, AppState), react and expo-constants used by the behaviour check (update on an SDK upgrade) |
Read only to change a checker |
scripts/lib/assemble-fixtures.mjs |
Builds each self-test case from templates + base repo + mutation.json |
Read only to add a self-test case |
scripts/selftest.mjs |
Proves both checkers on the clean repo, 89 planted problems (the Android ids, units, AD_ID permission and tracking cases included, the not-yet-due SKIP lines, a banner mounted or allowed before initialize, and the ATT order, plugin, locale, import, ads-off, decline, held and over-a-level cases, the L11 offer and status, and the debug geography included) and two passing facts (a type-only import of the debug tools; blocked permissions that leave AD_ID alone) |
After changing a checker, a template or a fixture |
scripts/check-lib.mjs |
Shared script helper, synced from the library (do not edit here) | Never by hand |
assets/shared.json |
Declares the shared files copied into this skill | When adding a shared file |
tests/fixtures/ |
base-repo/ plus one mutation.json and EXPECT.txt per case (bad-* must fail, pass-* must pass), per checker |
When adding a rule |
Related skills
premium-purchase- Premium turns ads off;isPremiumcomes from its store.privacy-and-network-audit- privacy manifest, App Privacy answers and the network audit after installing the SDK.architecture-and-boundaries- ports, adapters and wherewithShelllives.settings-and-preferences- the "Ad privacy choices" row in S11.toybox-visual-parity- Home, Levels and Statistics parity with the banner slot masked as dynamic pixels.game-host-integration- the game lifecycle thatrunFullscreenAdsuspends, and the Result-screen flow.save-persistence-and-migrations- the save's ads section that storesAdHistory.ios-release-testflight- the store-artifact gate that checksGADApplicationIdentifier.dependency-management- pinning and upgrading the SDK.
04 同仓库更多 Skills
unit-and-component-tests
Sets up Jest and writes Pocket Arcade test code - three projects, RNTL 14 async via renderWithShell, root SDK mocks, fakes, fast-check, coverage, Stryker. Use when a test needs the Shell wrapper, a mock or a fake, or Jest fails. Not for the red-green loop (tdd-workflow) or goldens (golden-tests).
typescript-and-lint-rules
Enforces Pocket Arcade's strict TypeScript 6 tsconfigs, ESLint 9 flat config, Prettier and size limits. Use when writing or splitting .ts/.tsx or fixing a tsc or lint error. Not for gate wiring (quality-gates), names (naming-conventions) or import zones (architecture-and-boundaries).
demo-skill
Builds a demo. Use when testing the pitfall checker.
demo-skill
Builds a demo. Use when testing the pitfall checker.
troubleshooting-playbook
Diagnoses and fixes Pocket Arcade failures with a catalogue of 300+ known ones (symptom, cause, fix). Use when something errors, crashes, hangs or renders wrong, or an error or log needs explaining. Not for gate setup (quality-gates) or running builds (ios-simulator-build, ios-release-testflight).
toybox-visual-parity
Proves a built Pocket Arcade screen matches its Toybox design screenshot (light/dark, en/fa) and drives the fixes: capture, element gates, sheets, sign-off. Use when any screen is built or changed, or for visual parity, design match, screenshot compare. Not for building screens (toybox-screens).