Skip to main content
Install the AdMob Plus Capacitor plugin and configure it for Android and iOS.

Prerequisites

Capacitor project initialized
AdMob account with app registered

Installation

1

Install the Package

Install using your package manager:
npm install @admob-plus/capacitor
2

Sync Native Projects

Sync the plugin with your native projects:
npx cap sync
3

Configure Android

Add your AdMob App ID to android/app/src/main/AndroidManifest.xml:
AndroidManifest.xml
<manifest>
  <application>
    <meta-data
      android:name="com.google.android.gms.ads.APPLICATION_ID"
      android:value="ca-app-pub-xxx~xxx" />
  </application>
</manifest>
Replace ca-app-pub-xxx~xxx with your actual Android AdMob App ID.
4

Configure iOS

Add your AdMob App ID to ios/App/App/Info.plist:
Info.plist
<key>GADApplicationIdentifier</key>
<string>ca-app-pub-xxx~xxx</string>
Replace ca-app-pub-xxx~xxx with your actual iOS AdMob App ID.
Then run:
npx cap sync ios

Platform-Specific Setup

Android Requirements

  • Minimum SDK: 21 (Android 5.0)
  • Target SDK: 33+
  • Google Play Services: Automatically included

iOS Requirements

  • iOS Version: 12.0+
  • CocoaPods: Automatically managed by Capacitor
The plugin automatically includes the Google Mobile Ads SDK via CocoaPods.

App Tracking Transparency (iOS)

For iOS 14+, add the tracking usage description to Info.plist:
Info.plist
<key>NSUserTrackingUsageDescription</key>
<string>This app uses your data for personalized advertising.</string>
Request tracking authorization in your app:
import { AdMobPlus } from '@admob-plus/capacitor';

const { status } = await AdMobPlus.requestTrackingAuthorization();
console.log('Tracking status:', status);

Verification

Verify the installation by checking the installed Capacitor plugins:
npx cap ls
You should see @admob-plus/capacitor in the list.

Troubleshooting

  1. Ensure your build.gradle uses the correct Google Play Services version
  2. Run npx cap sync android to refresh dependencies
  3. Clean and rebuild: cd android && ./gradlew clean && cd ..
  1. Update CocoaPods: cd ios/App && pod install && cd ../..
  2. If still failing, try: cd ios/App && pod deintegrate && pod install && cd ../..
  3. Run npx cap sync ios
Ensure you’ve run npx cap sync after installing the package.

Next Steps

Usage Guide

Learn how to display ads in your Capacitor app

Build docs developers (and LLMs) love