{"id":44820131,"url":"https://github.com/swaplab-engine/cordova-plugin-admob-nextgen","last_synced_at":"2026-05-23T21:01:09.953Z","repository":{"id":338326733,"uuid":"1157344963","full_name":"swaplab-engine/cordova-plugin-admob-nextgen","owner":"swaplab-engine","description":"🚀 Cordova AdMob Next-Gen Support Capacitor or Framework7","archived":false,"fork":false,"pushed_at":"2026-05-20T17:19:54.000Z","size":129,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-20T22:50:16.103Z","etag":null,"topics":["admob","admob-next-gen","admob-plugin","admob-sdk","capacitor-android","capacitor-plugin","capacitorjs","cordova","cordova-android","cordova-plugin","framework7","framework7-android","framework7-plugin","next-gen"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/swaplab-engine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["swaplab-engine"],"buymeacoffee":"emi.indo"}},"created_at":"2026-02-13T17:59:14.000Z","updated_at":"2026-05-20T17:20:19.000Z","dependencies_parsed_at":"2026-05-10T00:00:03.395Z","dependency_job_id":null,"html_url":"https://github.com/swaplab-engine/cordova-plugin-admob-nextgen","commit_stats":null,"previous_names":["swaplab-engine/cordova-plugin-admob-nextgen"],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/swaplab-engine/cordova-plugin-admob-nextgen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swaplab-engine%2Fcordova-plugin-admob-nextgen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swaplab-engine%2Fcordova-plugin-admob-nextgen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swaplab-engine%2Fcordova-plugin-admob-nextgen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swaplab-engine%2Fcordova-plugin-admob-nextgen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/swaplab-engine","download_url":"https://codeload.github.com/swaplab-engine/cordova-plugin-admob-nextgen/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swaplab-engine%2Fcordova-plugin-admob-nextgen/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33412082,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-23T18:09:33.147Z","status":"ssl_error","status_checked_at":"2026-05-23T18:09:31.380Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["admob","admob-next-gen","admob-plugin","admob-sdk","capacitor-android","capacitor-plugin","capacitorjs","cordova","cordova-android","cordova-plugin","framework7","framework7-android","framework7-plugin","next-gen"],"created_at":"2026-02-16T19:53:05.976Z","updated_at":"2026-05-23T21:01:09.946Z","avatar_url":"https://github.com/swaplab-engine.png","language":"Java","funding_links":["https://github.com/sponsors/swaplab-engine","emi.indo","https://www.buymeacoffee.com/emi.indo"],"categories":[],"sub_categories":[],"readme":"# Cordova AdMob Next-Gen Plugin\n\n[![Android](https://img.shields.io/badge/Platform-Android-green?logo=android)](https://www.android.com)\n[![iOS](https://img.shields.io/badge/Platform-iOS-lightgrey?logo=apple)](https://www.apple.com/ios)\n[![AdMob Next Gen](https://img.shields.io/badge/SDK-Google%20Mobile%20Ads%20Next--Gen-blue)](https://ads-developers.googleblog.com/2026/01/announcing-google-mobile-ads-next-gen.html)\n[![License](https://img.shields.io/badge/License-MIT-yellow)](LICENSE)\n\n[![NPM version](https://img.shields.io/npm/v/cordova-plugin-admob-nextgen.svg)](https://www.npmjs.com/package/cordova-plugin-admob-nextgen)\n[![Downloads](https://img.shields.io/npm/dm/cordova-plugin-admob-nextgen.svg)](https://www.npmjs.com/package/cordova-plugin-admob-nextgen)\n[![License](https://img.shields.io/npm/l/cordova-plugin-admob-nextgen.svg)](https://github.com/swaplab-engine/cordova-plugin-admob-nextgen/blob/main/LICENSE)\n\n**The Ultimate AdMob Monetization Solution for Cordova/Capacitor/Framework7.**\n\nThis plugin is a complete **rewrite and re-architecture** of the classic AdMob integration, built specifically for the **[Google Mobile Ads Next Generation SDK](https://ads-developers.googleblog.com/2026/01/announcing-google-mobile-ads-next-gen.html)**. \n\nIt moves away from legacy implementations to modern `SurfaceControl`, optimized layouts, and background threading, ensuring maximum performance, stability, and revenue.\n\n\u003e **Maintained by the original creator of [EMI-INDO/emi-indo-cordova-plugin-admob](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob).** This is not just an update; it is a brand new engine designed for 2026 and beyond.\n\n---\n\n## 🚀 Why Next-Gen?\n\nGoogle has introduced a fundamental shift in how ads are rendered on Android. \n\nThis plugin aligns perfectly with those changes to solve the most critical issues developers face today:\n\n1. **ANR Error Elimination:** \n   The legacy SDK is notorious for causing ANR (Application Not Responding) errors in the Google Play Console. This Next-Gen architecture fully resolves these threading bottlenecks. \n   *(See [Google's Next-Gen Announcement](https://ads-developers.googleblog.com/2026/01/announcing-google-mobile-ads-next-gen.html))*\n\n2. **Lifecycle Stability:** \n   Solves the notorious issue where Full-Screen Ads (Interstitial, Rewarded, App Open) would crash or disappear when the app goes to the background and returns to the foreground.\n\n3. **Smart Runtime Engine (Android 15 Edge-to-Edge):** \n   Intelligently detects and handles Android 14 (API 35) vs Android 15 (API 36) edge-to-edge conditions at runtime.\n   * Automatically secures the \"Close/X\" buttons on full-screen ads.\n   * When using the banner parameter `isOverlapping: false`, it intelligently calculates the system safe bottom insets to push the WebView content up perfectly.\n   * Ensures neither the ad nor your app UI is hidden behind the system navigation bar.\n   * Requires **zero** manual configuration from the user. \n   *(See [Release v1.3.9-beta.1](https://github.com/swaplab-engine/cordova-plugin-admob-nextgen/releases/tag/v1.3.9-beta.1))*\n\n4. **Cordova \u0026 Capacitor Agnostic:** \n   Intelligently identifies whether the runtime environment is Cordova or Capacitor (including deep native Java logic adjustments) to provide seamless compatibility.\n\n5. **Clean Architecture:** \n   Written from scratch using the official [Next Gen SDK Examples](https://github.com/googleads/gma-next-gen-sdk-android-examples), ensuring long-term compliance with Google Policies.\n\n\n## 💰 Mission: Revenue Maximization\n\nThis plugin is designed with one goal: \n\n**increasing your eCPM and fill rates**. \n\n It incorporates advanced formats and technologies that are proven to outperform standard implementations.\n\n### 1. True Next-Gen Speed: Ad Preloading API ⚡\nThis is the **real** Next-Gen feature, this plugin implements the specific Preload API methods: `startBannerPreload` and `showPreloadedBanner`.\n* **Zero Latency:** Instead of loading an ad when you need it, the plugin maintains a \"pool\" of ready-to-show ads in the background.\n* **Instant Show:** When you call `showPreloadedBanner`, the ad appears instantly (0ms delay) from the pool.\n\n### 2. Collapsible Banners (The Revenue Booster)\nStandard banners are often ignored by users. \n\nThis plugin supports **Collapsible Banners** natively.\n* **Impact:** Typically delivers **3-5% higher revenue** than standard or large adaptive banners.\n* **Mechanism:** Shows a larger ad initially (anchored top/bottom) that can be collapsed by the user, drastically increasing visibility and click-through rates (CTR).\n\n### 3. Native Advanced Overlay (The Banner Killer)\nMove beyond simple 320x50 banners. \n\nThe Native Overlay feature allows you to render high-performance Native Ads that look like system notifications.\n* **Impact:** Can yield **5-10% higher revenue** compared to standard banners due to higher advertiser demand for Native assets.\n* **Smart Templates:**\n    * `banner_bottom`: A sleek, notification-style ad docked at the bottom.\n    * `banner_top`: Docked at the top.\n    * `modal_center`: A popup-style native ad.\n* **Policy Safe:** Includes an `isOverlapping` parameter.\n* You can choose to overlay the ad (float) or push the webview content (safe layout), preventing accidental clicks.\n\n\n## 🛡️ Safety \u0026 Reliability\n\nThis plugin prioritizes the safety of your AdMob account and the stability of your app.\n\n* **Smart Throttling (`retryInterval`)**: Solves the dreaded \"high requests, low impressions\" (Invalid Traffic / IVT) issue.\n\n* This parameter acts as a strict anti-spam safeguard.\n* If an ad load is accidentally triggered repeatedly by an app logic error (e.g., game loop, tick, or scroll event) before the ad surfaces and is viewed by the user, the `retryInterval` automatically blocks the redundant requests.\n  \n  **Without this safeguard, you face two fatal problems:**\n  1. **Banner Ad Flickering:** Ads are constantly being destroyed and redrawn before becoming visible.\n  2. **Account Ban:** Aggressively pulling ads (spamming requests without impressions) is a serious violation of AdMob's Invalid Traffic policy.\n\n* **Background Thread Loading**: All ad requests are dispatched on background threads, ensuring your app's UI never freezes.\n\n\n---\n\n\n## Cordova/Capacitor/Framework7 AdMob Next-Gen: \n\n### Installation \u0026 Usage Guide\n\n---\n\u003e Fastest test (APK Debug): **[⚡ With github action ](https://github.com/swaplab-engine/cordova-plugin-admob-nextgen/discussions/4)** (Optional)\n---\n\n### 📦 Current SDK Versions (Maintained \u0026 Up-to-Date)\n\nThis plugin is regularly updated to support the latest standards.\n\n| Component | Platform | Version | Release Notes |\n| :--- | :--- | :--- | :--- |\n| **GMA Next-Gen SDK** | Android | **1.1.0** | [View Notes](https://developers.google.com/admob/android/next-gen/rel-notes) |\n| **UMP SDK** | Android | **4.0.0** | [View Notes](https://developers.google.com/admob/android/privacy/release-notes) |\n| **Mobile Ads SDK** | iOS | **13.3.0** | [View Notes](https://developers.google.com/admob/ios/rel-notes) |\n| **UMP SDK** | iOS | **3.1.0** | [View Notes](https://developers.google.com/ad-manager/mobile-ads-sdk/ios/privacy/download) |\n\n### 🎉 View all plugin release notes\n- 👉 [**Releases notes**](https://github.com/swaplab-engine/cordova-plugin-admob-nextgen/releases)\n\n---\n\n\n## 1. Cordova or Framework7\n\n### Option A: Via CLI\nInstall the plugin directly using the Cordova CLI, You must provide your AdMob App ID.\n\n    cordova plugin add cordova-plugin-admob-nextgen --save --variable APP_ID_ANDROID=\"ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy\" --variable APP_ID_IOS=\"ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy\"\n\n### Option B: Via config.xml\nAdd this to your `config.xml` to restore the plugin automatically.\n\n    \u003cplugin name=\"cordova-plugin-admob-nextgen\"\u003e\n        \u003cvariable name=\"APP_ID_ANDROID\" value=\"ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy\" /\u003e\n        \u003cvariable name=\"APP_ID_IOS\" value=\"ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy\" /\u003e\n    \u003c/plugin\u003e\n\n---\n\n## (Optional)\n\n### Supporting Mediation: **[⚡ admob-mediation-suite ](https://github.com/swaplab-engine/admob-mediation-suite)** (Optional)\n### Supporting Native ads: **[⚡ cordova-plugin-admob-nextgen-native ](https://github.com/swaplab-engine/cordova-plugin-admob-nextgen-native)** (Optional)\n\n---\n\n## For Capacitor users\n**[⚡ Capacitor Integration: Automated Setup for AdMob Next Gen ](https://github.com/swaplab-engine/cordova-plugin-admob-nextgen/discussions/3)**.\n\n**[⚡ AdMob Next Gen - Starter Capacitor Templates 🚀 ](https://github.com/swaplab-engine/cordova-plugin-admob-nextgen-template)**.\n\n---\n\n**[⚡ FULL Cordova - simple example 🚀 ](https://github.com/swaplab-engine/cordova-plugin-admob-nextgen/tree/main/simple-example/www/js)**.\n\n## 2. Configuration \u0026 Initialization (CRITICAL)\n\n**IMPORTANT:** Configure Global Settings and handle Privacy Consent (UMP) **BEFORE** initializing the SDK.\n\n### Step 1: Global Configuration (Run First)\n\n    // Optional: Mute ads globally\n    admobNextGen.setAppVolume(0.5);\n    admobNextGen.setAppMuted(true);\n\n### Step 2: Request Consent (UMP) \u0026 Initialize\n\n    // 1. Request Consent Information\n    admobNextGen.requestConsentInfo({\n        debug: false, // Set true for testing\n        reset: false,\n        tagForUnderAgeOfConsent: false\n    }, function() {\n        console.log(\"Consent Info Ready.\");\n        startSdk();\n\n    }, function(err) {\n        console.error(\"Consent Error\", err);\n        startSdk();\n    });\n\n\n    \n    // --- Consent Events ---\n    document.addEventListener('on.consent.status.change', (data) =\u003e {\n        console.log(data);\n    });\n    on.consent.info.update\n    on.consent.form.dismissed\n    on.consent.status.change  (obj)\n    on.consent.error  (obj)\n    \n   \n\n\n    // 3. Initialize the SDK\n    function startSdk() {\n        admobNextGen.initialize({\n            maxAdContentRating: 'G',  // 'G' | 'PG' | 'T' | 'MA' | \"\"\n            tagForChildDirectedTreatment: false, // true | false | null\n            tagForUnderAgeOfConsent: false, // true | false | null\n            // isNativeValidatorDisabled: false // optional param for: cordova-plugin-admob-nextgen-native\n        }, function() {\n            console.log(\"\u003e\u003e\u003e AdMob SDK Initialized \u0026 Ready \u003c\u003c\u003c\");\n        }, function(err) {\n            console.error(\"SDK Init Failed\", err);\n        });\n    }\n\n\n    // 4. Privacy options\n        admobNextGen.showPrivacyOptionsForm(function() {\n            startSdk();\n        }, function(err) {\n            startSdk();\n        });\n\n\n### App Tracking Transparency (ATT / IDFA) - iOS Only\nFor iOS 14+, Apple requires you to prompt the user before tracking their IDFA. \nThe plugin provides manual control over this prompt so you can display it at the right time in your app's lifecycle.\n\n```\nfunction checkAppTracking() {\n    admobNextGen.requestTrackingAuthorization(\n        function(status) {\n            console.log(\"ATT Status: \" + status); \n            // Returns: 'AUTHORIZED', 'DENIED', 'NOT_DETERMINED', 'RESTRICTED'\n            \n            // Regardless of the ATT choice, initialize the SDK\n            startSdk();\n        },\n        function(err) {\n            console.warn(\"ATT Request Failed\", err);\n            startSdk();\n        }\n    );\n}\n\n// You can also silently check the status anytime:\n// admobNextGen.getTrackingAuthorizationStatus(success, error);\n```   \n\n### Step 3: Check Consent Status (Smart Analysis)\nYou can check if the user has granted permission for Personalized Ads without parsing complex IAB strings manually.\n\n    admobNextGen.getTCData(function(data) {\n        // --- SMART ANALYSIS (Easy) ---\n        console.log(\"Personalized Allowed: \" + data.isPersonalizedAllowed); // Boolean: true/false\n        console.log(\"Status: \" + data.statusMessage);\n\n        // --- RAW DATA (Expert) ---\n        console.log(\"TC String: \" + data.tcString);\n        console.log(\"GDPR Applies: \" + data.gdprApplies); // 1=Yes, 0=No\n        console.log(\"Purpose Consents: \" + data.purposeConsents);\n    });\n\n---\n\n## 3. Banner Ads\n\nSupports **Adaptive**, **Standard**, and **Collapsible** banners.\n\n### Create Banner\n\n    admobNextGen.createBanner({\n        adUnitId: 'ca-app-pub-xxx/xxx',\n        position: 'bottom',       // 'top' or 'bottom'\n        size: 'ADAPTIVE',         // 'BANNER', 'LARGE_BANNER', 'MEDIUM_RECTANGLE', 'ADAPTIVE', 'FULL_BANNER', 'LEADERBOARD'\n        isOverlapping: false,     // true = Overlay, false = Push Webview\n        collapsible: true,        // true = Enable Collapsible Format (High Revenue)\n        retryInterval: 5000,      // Anti-spam delay (ms)\n        isAutoShow: true\n    });\n\n### New large banner adaptive size\n\n\u003e  new banner size min plugin version: 1.2+\n\n- LARGE_LANDSCAPE_ANCHORED_ADAPTIVE\n- LARGE_PORTRAIT_ANCHORED_ADAPTIVE\n- CURRENT_ORIENTATION_INLINE_ADAPTIVE\n- LARGE_ANCHORED_ADAPTIVE\n- PORTRAIT_INLINE_ADAPTIVE\n\n\n### Banner Methods\n\n    admobNextGen.showBanner();\n    admobNextGen.hideBanner();\n    admobNextGen.removeBanner();\n\n### Banner Events\n\n    document.addEventListener('on.banner.load', (data) =\u003e {\n        console.log(\"Banner Loaded: \" + data.width + \"x\" + data.height);\n        console.log(\"Collapsible: \" + data.isCollapsible);\n    });\n    document.addEventListener('on.banner.failed', (err) =\u003e console.error(err));\n    document.addEventListener('on.banner.revenue', (data) =\u003e {\n        console.log(\"Revenue: \" + data.value + \" \" + data.currency);\n    });\n    document.addEventListener('on.banner.clicked', () =\u003e console.log(\"Clicked\"));\n    document.addEventListener('on.banner.impression', () =\u003e console.log(\"Impression\"));\n\n    // else\n    on.banner.opened\n    on.banner.closed\n    on.banner.failed.show\n    on.banner.refreshed\n    on.banner.refresh.failed\n\n---\n\n## 4. Native Ads (Advanced Overlay) - Android Only\n\n- Recommended: **[⚡ cordova-plugin-admob-nextgen-native ](https://github.com/swaplab-engine/cordova-plugin-admob-nextgen-native)** (Android | IOS)\n\nHigh-performance native templates.\n\n### Example A: Using Templates (Recommended)\n    // Android Only\n    admobNextGen.createNativeAd({\n        adUnitId: 'ca-app-pub-xxx/xxx',\n        view: 'banner_bottom',    // Presets: 'banner_top', 'banner_bottom', 'modal_center'\n        isOverlapping: false,     // true = Overlay, false = Push Content\n        retryInterval: 5000\n    });\n\n### Example B: Custom Position (Manual Coordinates)\n    // Android Only\n    admobNextGen.createNativeAd({\n        adUnitId: 'ca-app-pub-xxx/xxx',\n        view: 'custom',\n        x: 20,              // X Position in dp\n        y: 100,             // Y Position in dp\n        width: 300,         // Width in dp\n        height: 300,        // Height in dp\n        isOverlapping: true // Typically true for custom floating ads\n    });\n\n### Native Methods \u0026 Events\n    // Android Only\n    admobNextGen.removeNativeAd();\n\n    document.addEventListener('on.native.loaded', () =\u003e console.log(\"Native Loaded\"));\n    document.addEventListener('on.native.revenue', (data) =\u003e console.log(\"Revenue:\", data.value));\n\n    // else\n    on.native.shown\n    on.native.failed\n    on.native.dismissed\n    on.native.show.failed  (obj)\n    on.native.impression\n    on.native.clicked\n\n\n---\n\n## 6. App Open Ads\n\nSupports Auto-Resume logic.\n\n### Load App Open\n\n    admobNextGen.loadAppOpenAd({\n        adUnitId: 'ca-app-pub-xxx/xxx',\n        isAutoShow: true, // Automatically show when app resumes from background\n        retryInterval: 5000\n    });\n\n### Manual Show\n\n    admobNextGen.showAppOpenAd();\n\n### App Open Events\n\n    document.addEventListener('on.appopen.revenue', (data) =\u003e console.log(data));\n    document.addEventListener('on.appopen.dismissed', () =\u003e console.log(\"Closed\"));\n\n    // else\n    on.appopen.loaded\n    on.appopen.failed.load (obj)\n    on.appopen.failed.show (obj)\n    on.appopen.revenue (obj)\n    on.appopen.shown\n    on.appopen.dismissed\n    on.appopen.failed.show (obj)\n    on.appopen.impression\n    on.appopen.clicked\n\n\n---\n\n## 7. Interstitial Ads\n\n### Load \u0026 Show\n\n    admobNextGen.createInterstitial({\n        adUnitId: 'ca-app-pub-xxx/xxx',\n        isAutoShow: true, // Show immediately when loaded\n        retryInterval: 5000\n    });\n\n    // Manual Show\n    // admobNextGen.showInterstitial();\n\n### Events\n\n    document.addEventListener('on.interstitial.revenue', (data) =\u003e console.log(data));\n    document.addEventListener('on.interstitial.dismissed', () =\u003e console.log(\"Closed\"));\n\n    // else\n    on.interstitial.loaded\n    on.interstitial.failed.load (obj)\n    on.interstitial.failed.show (obj)\n    on.interstitial.revenue (obj)\n    on.interstitial.shown\n    on.interstitial.dismissed\n    on.interstitial.failed.show (obj)\n    on.interstitial.impression\n    on.interstitial.clicked\n\n---\n\n## 8. Rewarded Video\n\n### Load \u0026 Show\n\n    admobNextGen.createRewarded({\n        adUnitId: 'ca-app-pub-xxx/xxx',\n        retryInterval: 5000,  // Anti-spam interval\n        isAutoShow: false     // Default false (User must opt-in)\n    });\n\n    // Show manually when ready\n    admobNextGen.showRewarded();\n\n### Events\n\n    document.addEventListener('on.rewarded.earned', (data) =\u003e {\n        console.log(\"User Earned: \" + data.amount + \" \" + data.type);\n    });\n    document.addEventListener('on.rewarded.revenue', (data) =\u003e console.log(data));\n\n    // else\n    on.rewarded.loaded\n    on.rewarded.failed.load (obj)\n    on.rewarded.failed.show (obj)\n    on.rewarded.revenue (obj)\n    on.rewarded.shown\n    on.rewarded.canceled\n    on.rewarded.dismissed\n    on.rewarded.failed.show (obj)\n    on.rewarded.impression\n    on.rewarded.clicked\n\n---\n\n## 9. Rewarded Interstitial\n\nAuto-showing rewarded format (no opt-in).\n\n### Load \u0026 Show\n\n    admobNextGen.createRewardedInterstitial({\n        adUnitId: 'ca-app-pub-xxx/xxx',\n        isAutoShow: true,\n        retryInterval: 5000 // Anti-spam interval\n    });\n\n### Events\n\n    document.addEventListener('on.rewardedInter.earned', (data) =\u003e console.log(data));\n    document.addEventListener('on.rewardedInter.revenue', (data) =\u003e console.log(data));\n\n    // else\n    on.rewardedInter.loaded\n    on.rewardedInter.failed.load (obj)\n    on.rewardedInter.failed.show (obj)\n    on.rewardedInter.revenue (obj)\n    on.rewardedInter.shown\n    on.rewardedInter.canceled\n    on.rewardedInter.dismissed\n    on.rewardedInter.failed.show (obj)\n    on.rewardedInter.impression\n    on.rewardedInter.clicked\n\n\n---\n\n\n## 10. Preloader Engine (Android Only - Next-Gen SDK)\n\nThe AdMob Next-Gen SDK introduces a powerful background Preloader Engine that caches ads in a buffer pool, enabling zero-latency ad rendering.\n\n\u003e **⚠️ IMPORTANT WARNING \u0026 BEST PRACTICES:**\n\u003e * **Android Only:** The Preloader engine is currently an exclusive feature of the Android Next-Gen SDK.\n\u003e * **Strict Method Separation:** NEVER mix Classic methods with Preloader methods to avoid logic conflicts. \n\u003e   * If you use `createBanner`, you MUST use `showBanner`. \n\u003e   * If you use `startBannerPreload`, you MUST use `showPreloadedBanner`.\n\u003e * **Cross-Platform (iOS) Consideration:** Events are unified. A `source` flag (`data.source === \"preloader\"`) is injected into the event data on Android. However, it is highly recommended to maintain a single unified logic flow. Relying strictly on the `source === \"preloader\"` condition will cause issues on iOS, as iOS relies entirely on the Classic implementation.\n\n### Method Mapping (Classic vs Preloader)\n\n| Ad Format | Start Preload | Show Polled Ad | Other Preload Methods |\n| :--- | :--- | :--- | :--- |\n| **Banner** | `startBannerPreload(obj)` | `showPreloadedBanner()` | `stopBannerPreload()`, `hideBannerPreload()` |\n| **App Open** | `startAppOpenPreload(obj)` | `showPreloadedAppOpenAd()` | `isAppOpenAdAvailable()` |\n| **Interstitial** | `startInterstitialPreload(obj)` | `showPreloadedInterstitial()` | `stopInterstitialPreload()`, `isInterstitialAdAvailable()` |\n| **Rewarded** | `startRewardedPreload(obj)` | `showPreloadedRewarded()` | `stopRewardedPreload()`, `isRewardedAdAvailable()` |\n| **Rewarded Interstitial** | `startRewardedInterstitialPreload(obj)` | `showPreloadedRewardedInterstitial()` | `stopRewardedInterstitialPreload()`, `isRewardedInterstitialAdAvailable()` |\n\n### Implementation Example\n\n- [⚡ Example preloading ](https://github.com/swaplab-engine/cordova-plugin-admob-nextgen/tree/main/simple-example/www/js/preloading)\n\n**1. Start the Preloader**\nRun this once (e.g., after SDK initialization). The engine will automatically maintain the buffer in the background.\n\n```javascript\nadmobNextGen.startRewardedPreload({\n    adUnitId: 'ca-app-pub-xxx/xxx',\n    bufferSize: 2,         // (Optional) Number of ads to cache. Default: 1 max 3\n    isAutoShow: false,     // (Optional) Show immediately when the first ad is ready\n    retryInterval: 5000    // (Optional) Anti-spam protection in ms\n});\n```\n\n**2. Show the Preloaded Ad**\nCall this when the user interacts with your app. It will render instantly from the local buffer.\n\n```javascript\nadmobNextGen.showPreloadedRewarded();\n```\n\n### Unified Events \u0026 Preloader Exclusives\n\nTo streamline development, the Preloader triggers the **exact same lifecycle events** as the Classic mode (e.g., `on.rewarded.loaded`, `on.rewarded.dismissed`). You only need to write one event listener for both modes.\n\n**Preloader Exclusive Event:**\nThe only event strictly unique to the Preloader is the `exhausted` event. This fires when the buffer pool is completely empty and the SDK stops trying to fetch new ads.\n\n```javascript\n// Example: Unique Preloader Event\ndocument.addEventListener('on.rewarded.exhausted', () =\u003e {\n    console.warn(\"Background ad buffer is empty!\");\n});\n```\n\n**Optional: Checking the Event Source**\nIf you need to execute specific conditional logic for the preloader, you can check `data.source`. *(Remember: This flag is Android-only).*\n\n```javascript\ndocument.addEventListener('on.rewarded.loaded', (e) =\u003e {\n    let data = e.data || e;\n    \n    if (data \u0026\u0026 data.source === \"preloader\") {\n        console.log(\"Ad loaded via Android Preloader Engine\");\n    } else {\n        console.log(\"Ad loaded via Classic Engine (or iOS)\");\n    }\n});\n```\n\n---\n\n\n## ⚖️ Revenue Policy\n\n**No Ad-Sharing. No Hidden Fees.**\n\nUnlike many other free plugins, this project is clean:\n* **0% Revenue Share:** This plugin do not inject our own Ad Unit IDs into your traffic.\n* **100% Control:** Every impression and click goes directly to your AdMob account.\n* **Transparent Source:** The code is open source. You can verify that no third-party SDKs or hidden backdoors exist.\n\n---\n\n## ❤️ Support the Project\n\nThis plugin is developed and maintained in my free time. \nIf it saved you hours of work, consider supporting the development!\n\n\u003ca href=\"https://www.buymeacoffee.com/emi.indo\" target=\"_blank\"\u003e\n  \u003cimg src=\"https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png\" alt=\"Buy Me A Coffee\" style=\"height: 60px !important;width: 217px !important;\" \u003e\n\u003c/a\u003e\n\nYour support helps me keep the dependencies updated and the cleaner script running smoothly.\n\n\n\u003cp align=\"center\"\u003e\n  Built with ❤️ by \u003cb\u003eSwaplab Engine\u003c/b\u003e (formerly EMI-INDO).\n\u003c/p\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswaplab-engine%2Fcordova-plugin-admob-nextgen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswaplab-engine%2Fcordova-plugin-admob-nextgen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswaplab-engine%2Fcordova-plugin-admob-nextgen/lists"}