Integrating Firebase AdMob with Android/iOS applications
AdMob makes your mobile application profitable using nothing but plain good old ads, the integration with Firebase that also provides other services like analytics and more advanced metrics makes Firebase and AdMob the perfect mix. So in the recipes, we're going to cover how we can integrate them into Android and iOS.
How to do it...
We will first discover how to integrate Firebase AdMob within our Android application:
- Fire up Android Studio and open your
build.gradle
file. Add the following line underneath your already present dependencies:
compile 'com.google.firebase:firebase-ads:11.0.4'
- Save and sync, and then, in Android Studio, go and download and install the needed dependencies and configure your project accordingly.
- Now in your main activity Java class, initialize your AdMob integration with your AdMob app ID by adding the following line to your
onCreate
method:
MobileAds.initialize(this,"<Admob-App-Id>");
This line...