sunnycupertino / cordova-plugin-admob-simple

Cordova plugin allowing Admob interstitials and banner ads.
MIT License
164 stars 150 forks source link

Cordova/Phonegap AdMob Plugin

The FASTEST and EASIEST TO USE Cordova Admob plugin for Android, iOS and Windows phone. We do not send your apps details to our servers. Pure OpenSource Admob code. Allows preloading and automatic loading of interstitials and banners plus more. Works with Cordova, Phonegap, Intel XDK/Crosswalk, Ionic, Meteor and more.

CONTENTS

  1. DESCRIPTION
  2. QUICK START
  3. CODING DETAILS - Load interstitial first and show later
  4. CODING DETAILS - Show interstitial when it's loaded
  5. VIDEO DEMO
  6. ECLIPSE NOTES
  7. ANDROID STUDIO NOTES
  8. CAUTION

DESCRIPTION

A Cordova-Phonegap plugin that allows you to integrate Google Admob ads into your iOS or Android app and display banners or interstitials. Cordova allows you to build cross platform HTML 5 and Javascript apps without having to rewrite in Objective C or Java.

QUICK START

cordova create hallo com.example.hallo HalloWorld

cd hallo

cordova platform add android

CODING DETAILS Load interstitial first and show later

- Add the following 2 functions and call them when you want ads to show
```javascript
//display the banner
function showBannerFunc(){
    window.plugins.AdMob.createBannerView();
}
//display the interstitial
function showInterstitialFunc(){
    window.plugins.AdMob.showInterstitialAd();
}

CODING DETAILS Show interstitial when it is loaded

- Add the following 2 functions and call them when you want ads to show
```javascript
//display the banner
function showBannerFunc(){
    window.plugins.AdMob.createBannerView();
}
//display the interstitial
function showInterstitialFunc(){
    window.plugins.AdMob.createInterstitialView();  //get the interstitials ready to be shown and show when it's loaded.
    window.plugins.AdMob.requestInterstitialAd();
}

VIDEO DEMO

Video

ECLIPSE NOTES

ANDROID STUDIO NOTES

CAUTION

Credits to Liming Xie

The MIT License (MIT)

Copyright (c) 2016 Sunny Cupertino,

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. DISCLAIMER. TWO PERCENT OF THE AD REQUESTS GO TO THE DEVS.

track