Friday, February 26, 2016

Add AdMob to Ionic Framework [Update]

Add AdMob to Ionic Framework

1. Add AdMob Plugin to your project


cordova plugin add cordova-plugin-admobpro
2. Create the banner in your AdMob account
3. add in the app
Add this code to your app (app.js)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
if( ionic.Platform.isAndroid() )  {
        admobid = { // for Android
          banner: ‘you pub’
        };

        if(AdMob)
          AdMob.createBanner(
            {
              adId:admobid.banner,
              position:AdMob.AD_POSITION.BOTTOM_CENTER,
              autoShow:true
            }
          );
    }



endjoy :)

No comments:

Post a Comment

Comments system

Disqus Shortname

Disqus Shortname

Comments system