Skip to content

AppGyver/phonegap-admob-plugin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cordova-plugin-admob

AdMob Steroids Plugin for Android and iOS.

compatible with:

  • Steroids iOS 3.1.5 and higher
  • Steroids Android 3.1.3 and higher

##Implementation:

There are two calls needed to get AdMob Ads:

  1. createBannerView

    Takes in a object containing a publisherId and adSize, as well as success and failure callbacks. An example call is provided below:

      admob.createBannerView(
          {
            'publisherId': 'INSERT_YOUR_AD_UNIT_ID_HERE',
            'adSize': admob.AD_SIZE.BANNER
          },
          successCallback,
          failureCallback
      );
    
  2. requestAd

    Takes in an object containing an optional testing flag, and an optional list of extras. This method should only be invoked once createBannerView has invoked successCallback. An example call is provided below:

      admob.requestAd(
          {
            'isTesting': false,
            'extras': {
              'color_bg': 'AAAAFF',
              'color_bg_top': 'FFFFFF',
              'color_border': 'FFFFFF',
              'color_link': '000080',
              'color_text': '808080',
              'color_url': '008000'
            },
          },
          successCallback,
          failureCallback
      );
    

This plugin also allows you the option to listen for ad events. The following events are supported:

     document.addEventListener('onReceiveAd', callback);
     document.addEventListener('onFailedToReceiveAd', callback);
     document.addEventListener('onDismissScreen', callback);
     document.addEventListener('onPresentScreen', callback);
     document.addEventListener('onLeaveApplication', callback);

If you want to create an Interstitials sur createInterstitialView

     admob.createInterstitialView(
     {
       'publisherId': 'INSERT_YOUR_AD_UNIT_ID_HERE'
     },
     successCallback,
     failureCallback);

If you want Kill banner :

     admob.killAd(successCallback,failureCallback);

Based on:
https://github.com/rajpara11/phonegap-plugins/tree/master/Android/AdMobPlugin
https://github.com/rajpara11/phonegap-plugins/tree/master/iOS/AdMobPlugin
with Interstitials support

About

AdMob Steroids Plugin for Android and iOS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Objective-C 60.2%
  • Java 25.0%
  • JavaScript 14.8%