Admob plugin for Cordova, using Google Play Framework
-
Copy
google-play-services_lib
from SDK toplatform/android
-
Update library in
platform/android/google-play-services_lib
android update project -s -t <target> -p .
- Add Play Services library to the project in
platform/android
android update project -s -t <target> -p . -l google-play-services_lib
- Add the below line to
platform/android/AndroidManifest.xml
within<application>
tag
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
cordova plugin add https://github.com/abdulmueid/cordova-admob-plugin
- Initialize the plugin on
deviceready
event. Replacepublisher_ID
with your publisher ID.
Admob.initAd(publisher_ID);
- Show Ad by calling
Admob.showAd()
- Hide Ad by calling
Admob.hideAd()