AdMobs with Ionic

Has anyone had any recent success integrating Admobs into their project? I’ve tried multiple tutorial without success.

I can give you a quick answer, yes I managed to do that few days ago. And that’s a wrong question :smile:

It will not help in your case.

Tell us what went wrong? And which tutorial have you used?

I’ve used the following tutorials, in each test the ads never appear in the emulator.


Is their an example showing were this code should be placed in an ionic app?

I tried the same thing, but it seems de repository is deprecated
Nothing works for me :

I created a new project to try the tutorial.

You can follow the tutorial : http://www.nikola-breznjak.com/blog/ionic/adding-admob-to-ionic-framework-application-step-by-step/

Step by step but instead add admob plugin,you have to add the pro one

cordova plugin add https://github.com/floatinghotpot/cordova-admob-pro
1 Like

DId that, and it worked great. Every time I try it in an app I start from scratch I receive a build error at :compileDebugJava Admob.java:219: error: cannot find symbol ((ViewGroup)) webView.getRootView()).addView(adViewLayout, params);
symbol: method getRootView()
location: variable webView of type CordovaWebView

It seems you use the old version of cordova AdMob, you have to try the pro version if your cordova’s version is >= 5.0

It was said by its developer

https://github.com/floatinghotpot/cordova-plugin-admob/issues/186

If it works for you on the emulator AND on your Android phone. Please let me know

You can also try this plugin at https://github.com/appfeel/admob-google-cordova with great tutorial: https://github.com/appfeel/admob-google-cordova/wiki/Angular.js,-Ionic-apps