Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/admob-plus/admob-plus/llms.txt

Use this file to discover all available pages before exploring further.

This guide walks you through installing the AdMob Plus plugin in your Apache Cordova project.

Prerequisites

Cordova CLI installed (npm install -g cordova)
An existing Cordova project
AdMob account with app registered

Installation

1

Install the Plugin

Add the plugin to your Cordova project:
cordova plugin add admob-plus-cordova
The plugin will automatically configure itself for Android and iOS platforms.
2

Configure App IDs

Set your AdMob App IDs using Cordova preferences in config.xml:
config.xml
<preference name="ADMOB_APP_ID_ANDROID" value="ca-app-pub-xxx~xxx" />
<preference name="ADMOB_APP_ID_IOS" value="ca-app-pub-xxx~xxx" />
Replace ca-app-pub-xxx~xxx with your actual AdMob App IDs from the AdMob console.
3

Add TypeScript Support (Optional)

If you’re using TypeScript, install type definitions:
npm install --save-dev @types/cordova
The plugin includes its own TypeScript definitions at esm/index.d.ts.
4

Build Your Project

Build for your target platforms:
cordova build android
cordova build ios

Platform-Specific Configuration

Android

The plugin automatically adds the required Google Mobile Ads SDK dependency in build.gradle. Minimum Requirements:
  • Android SDK 21+
  • Cordova Android 10.0.0+

iOS

The plugin includes a CocoaPods dependency for the Google Mobile Ads SDK. Minimum Requirements:
  • iOS 12.0+
  • Cordova iOS 6.0.0+
  • CocoaPods installed
Run pod repo update if you encounter dependency resolution issues.

Verification

Verify the installation by checking the installed plugins:
cordova plugin list
You should see admob-plus-cordova in the list.

Troubleshooting

This usually indicates a Gradle sync issue on Android. Try:
  1. Remove and re-add the Android platform: cordova platform rm android && cordova platform add android
  2. Clean the build: cordova clean android
  3. Rebuild: cordova build android
  1. Update CocoaPods: pod repo update
  2. Navigate to platforms/ios and run: pod install
  3. Rebuild: cordova build ios
Ensure you’ve set both ADMOB_APP_ID_ANDROID and ADMOB_APP_ID_IOS preferences in config.xml before building.

Next Steps

Usage Guide

Learn how to display ads in your Cordova app