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.

Install the AdMob Plus Ionic Native wrapper in your Ionic Framework project.

Prerequisites

Ionic project initialized
Ionic Native Core installed
AdMob account with app registered

Installation

Ionic projects can use either Cordova or Capacitor as the native runtime. Choose the appropriate installation method:
1

Install the Packages

Install both the Ionic Native wrapper and the Cordova plugin:
npm install @admob-plus/ionic admob-plus-cordova @ionic-native/core
2

Configure App IDs

Set your AdMob App IDs 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" />
3

Add to Module

Import in your Angular module:
app.module.ts
import { NgModule } from '@angular/core';
import { AdMob } from '@admob-plus/ionic/ngx';

@NgModule({
  providers: [
    AdMob,
  ],
})
export class AppModule {}
4

Build the Project

ionic cordova build android
ionic cordova build ios

Verification

Verify the installation: Cordova:
ionic cordova plugin list
Capacitor:
npx cap ls
You should see admob-plus-cordova in the list.

Troubleshooting

Ensure you’ve added AdMob to the providers array in your module and imported from @admob-plus/ionic/ngx.
  1. Ensure admob-plus-cordova is installed
  2. For Cordova: Run ionic cordova platform rm android && ionic cordova platform add android
  3. For Capacitor: Run npx cap sync
  1. Clean the project: ionic build --clean
  2. Remove and reinstall node modules
  3. For Cordova: Remove and re-add platforms
  4. For Capacitor: Run npx cap sync again

Next Steps

Usage Guide

Learn how to display ads in your Ionic app