Skip to content

fix(admob): harden consent, banners, and variant builds - #2553

Open
deadlyjack wants to merge 2 commits into
mainfrom
fix/admob-consent-banner-variants
Open

fix(admob): harden consent, banners, and variant builds#2553
deadlyjack wants to merge 2 commits into
mainfrom
fix/admob-consent-banner-variants

Conversation

@deadlyjack

Copy link
Copy Markdown
Member
  • integrate UMP consent handling and reactive privacy choices
  • serialize adaptive banner visibility across pages and keyboard changes
  • make free and paid Cordova variant configuration idempotent
  • commit and validate a deterministic self-contained AdMob bundle
  • remove vulnerable legacy toolchains and update affected lockfiles
  • replace the legacy soft-input workaround with adjustResize
  • add tests, lockfile checks, bundle freshness, and security auditing to CI

- integrate UMP consent handling and reactive privacy choices
- serialize adaptive banner visibility across pages and keyboard changes
- make free and paid Cordova variant configuration idempotent
- commit and validate a deterministic self-contained AdMob bundle
- remove vulnerable legacy toolchains and update affected lockfiles
- replace the legacy soft-input workaround with adjustResize
- add tests, lockfile checks, bundle freshness, and security auditing to CI
@greptile-apps

greptile-apps Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR hardens AdMob consent, banner visibility, rewarded-pass lifecycle handling, Android variant builds, and CI validation.

  • Replaces persistent banner suspension with independent named suppression reasons for Pro and rewarded-pass states.
  • Refreshes rewarded state at expiry and resume, clearing rewarded suppression and reconciling already registered pages.
  • Serializes native banner visibility across page transitions and keyboard changes.
  • Integrates UMP privacy controls and updates native AdMob plugin sources and generated bundle checks.
  • Makes Cordova free and paid variant configuration idempotent.
  • Updates dependencies, lockfiles, Android soft-input behavior, tests, and security-oriented CI checks.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains; the previously reported rewarded-pass banner suspension is now cleared through the same reason-scoped lifecycle on expiry and resume, immediately reconciling registered pages.

Important Files Changed

Filename Overview
src/lib/adRewards.js Integrates rewarded-ad state with the new lifecycle so redemption, expiry, and resume consistently update banner suppression.
src/lib/adRewardBannerPolicy.mjs Centralizes normalized reward-state application, expiry scheduling, refresh handling, and rewarded-pass suppression.
src/lib/bannerVisibilityController.mjs Adds page-aware, keyboard-aware, reason-scoped, serialized native banner visibility management.
src/lib/startAd.js Connects AdMob banner operations and suppression updates to the shared visibility controller.
src/plugins/admob/src/android/cordova/Privacy.kt Implements native UMP consent and privacy-choice operations for the Cordova bridge.
hooks/post-process.js Makes Cordova package-variant processing repeatable across free and paid builds.
.github/workflows/ci.yml Adds unit, type, generated-bundle, lockfile, dependency-audit, and native AdMob checks.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  Reward[Reward state refresh or redemption] --> Normalize[Normalize reward status]
  Normalize --> Active{Pass active until adFreeUntil?}
  Active -->|Yes| Suppress[Add rewarded-pass suppression]
  Active -->|No| Clear[Remove rewarded-pass suppression]
  Suppress --> Reconcile[Reconcile banner visibility]
  Clear --> Reconcile
  Page[Active registered page] --> Reconcile
  Keyboard[Keyboard visibility] --> Reconcile
  Pro[Pro suppression] --> Reconcile
  Reconcile --> Visible{Page requests banner and no suppression or keyboard?}
  Visible -->|Yes| Show[Queue native banner show]
  Visible -->|No| Hide[Queue native banner hide]
Loading

Reviews (2): Last reviewed commit: "fix(admob): harden banner suppression an..." | Re-trigger Greptile

- make banner suppression reason-aware across Pro and rewarded passes
- centralize reward state refresh, expiry scheduling, and failure handling
- remove stale Cordova consent and persisted AdMob variant metadata
- add ES2020-compatible access and Java 21 Android native CI coverage
- enforce transient plugin setup and clean tracked build state
- remove the obsolete large-screen quicktools tutorial
Comment thread .github/workflows/ci.yml
Comment on lines +45 to +92
timeout-minutes: 15
name: Unit and dependency checks
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v7

- name: Use Node.js
uses: actions/setup-node@v7
with:
node-version: 22
cache: npm
cache-dependency-path: |
package-lock.json
src/plugins/admob/package-lock.json
src/plugins/cordova-plugin-advanced-http/package-lock.json

- name: Use Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.9

- name: Install dependencies
run: npm ci --no-audit --no-fund

- name: Run JavaScript tests
run: npm test

- name: Run typecheck
run: npm run typecheck

- name: Verify generated AdMob bundle
run: |
npm run build:admob
npm run check:admob-bundle
git diff --exit-code -- src/plugins/admob/www/admob.js

- name: Verify Bun lockfile
run: bun install --frozen-lockfile --dry-run

- name: Reject critical dependency advisories
run: |
npm audit --package-lock-only --audit-level=critical
npm audit --prefix src/plugins/admob --package-lock-only --audit-level=critical
npm audit --prefix src/plugins/cordova-plugin-advanced-http --package-lock-only --audit-level=critical

admob-native-tests:
@deadlyjack

This comment was marked as outdated.

Comment thread utils/scripts/dev.js
return sanitized;
}

function getAppVariant(args) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

paid dev builds are ignored, is that intentional?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

3 participants