AdMob

You can use AdMob with Ionic to monetize your app showing publicity. Learn how we use AdMob in Ion2FullApp Ionic Template.

Before you can serve any AdMob ads you must sign up for an AdMob account at www.admob.com. AdMob does not charge a fee for creating an account or for serving up AdMob ads (be aware that some AdMob plugins vendors do charge a fee for the use of their plugin). If you have an AdMob account you must create a set of Ad Unit IDs that identify your ad impressions and provide these IDs as part of the AdMob API initialization sequence within your app.

IMPORTANT: each application should have its own set of Ad Unit IDs! If you do not yet have an app in an app store, you can use the "manual" method to identify your app for the purpose of obtaining Ad Unit IDs. We will use cordova admob pro plugin.

To install the plugin you have to run the following command line:

$ ionic cordova plugin add cordova-plugin-admob-free
$ npm install --save @ionic-native/admob-free

We included two examples of the type of ads you can show in your app:

  • Banner ad

  • Interstitial ad

You can find the related code in src/pages/ads/ads.ts

Last updated