Skip to main content
Version: 1.x

Installation

npx admob-plus install -p cordova

Or via Cordova CLI:

cordova plugin add admob-plus-cordova --save --variable APP_ID_ANDROID=ca-app-pub-xxx~xxx --variable APP_ID_IOS=ca-app-pub-xxx~xxx

com.google.android.gms:play-services-ads:$PLAY_SERVICES_VERSION is available for configuration, the default is --PLAY_SERVICES_VERSION=20.1.0.

When using with other plugins and encountering errors, set AndroidXEnabled to true.

config.xml
<widget>
<platform name="android">
<preference name="AndroidXEnabled" value="true" />
</platform>
</widget>

Or add the following plugins for Cordova<9,

cordova plugin add cordova-plugin-androidx
cordova plugin add cordova-plugin-androidx-adapter

Proguard

Add these rules to your proguard configuration:

-keep public class admob.plugin.ads.** {
public *;
}