Need help upgrading to Ionic Framework 4.0? Get assistance with our Enterprise Migration Services EXPLORE NOW

AdMob Free

Improve this doc

A free, no ad-sharing version of Google AdMob plugin for Cordova.

Requires Cordova plugin: cordova-plugin-admob-free. For more info, please see the AdMob Free plugin docs.

Repo: https://github.com/ratson/cordova-plugin-admob-free

Installation

  1. Install the Cordova and Ionic Native plugins:
    $ ionic cordova plugin add cordova-plugin-admob-free
    $ npm install --save @ionic-native/admob-free@4
    
  2. Add this plugin to your app's module

Supported platforms

Usage

import { AdMobFree, AdMobFreeBannerConfig } from '@ionic-native/admob-free';


constructor(private admobFree: AdMobFree) { }


...


const bannerConfig: AdMobFreeBannerConfig = {
 // add your config here
 // for the sake of this example we will just use the test config
 isTesting: true,
 autoShow: true
};
this.admobFree.banner.config(bannerConfig);

this.admobFree.banner.prepare()
  .then(() => {
    // banner Ad is ready
    // if we set autoShow to false, then we will need to call the show method here
  })
  .catch(e => console.log(e));

Instance Members

events

Convenience object to get event names

on(event)

Watch an event

Param Type Details
event string

event name

Returns: Observable<any>

banner

Returns the AdMobFreeBanner object

interstitial

Returns the AdMobFreeInterstitial object

rewardVideo

Returns the AdMobFreeRewardVideo object

AdMobFreeBanner

Instance Members

config(options)

Update config

Param Type Details
options

Returns: AdMobFreeBannerConfig

hide()

Hide the banner

Returns: Promise<any>

prepare()

Create banner

Returns: Promise<any>

remove()

Remove the banner

Returns: Promise<any>

show()

Show the banner

Returns: Promise<any>

AdMobFreeInterstitial

Instance Members

config(options)

Update config

Param Type Details
options

Returns: AdMobFreeInterstitialConfig

isReady()

Check if interstitial is ready

Returns: Promise<any>

prepare()

Prepare interstitial

Returns: Promise<any>

show()

Show the interstitial

Returns: Promise<any>

AdMobFreeRewardVideo

Instance Members

config(options)

Update config

Param Type Details
options AdMobFreeRewardVideoConfig

Admob reward config

Returns: AdMobFreeRewardVideoConfig

isReady()

Check if reward video is ready

Returns: Promise<any>

prepare()

Prepare reward video

Returns: Promise<any>

show()

Show the reward video

Returns: Promise<any>

AdMobFreeBannerConfig

Param Type Details
id string

Ad Unit ID

(optional)
isTesting boolean

Receiving test ad

(optional)
autoShow boolean

Auto show ad when loaded

(optional)
bannerAtTop boolean

Set to true, to put banner at top

(optional)
overlap boolean

Set to true, to allow banner overlap WebView

(optional)
offsetTopBar boolean

Set to true to avoid ios7 status bar overlap

(optional)
size string

Banner size

(optional)

AdMobFreeInterstitialConfig

Param Type Details
id string

Ad Unit ID

(optional)
isTesting boolean

Receiving test ad

(optional)
autoShow boolean

Auto show ad when loaded

(optional)

AdMobFreeRewardVideoConfig

Param Type Details
id string

Ad Unit ID

(optional)
isTesting boolean

Receiving test ad

(optional)
autoShow boolean

Auto show ad when loaded

(optional)

API

Native

General