Categories

Follow Us @web_learners

Sunday, May 17, 2020

Facebook Interstitial Ads Integration in Android App | Admob Alternative Ad network

Hi, Today I am going to show you How to integrate Facebook Interstitial Ads in the Android app.
In the next post, I will show you How to integrate Facebook Native banner Ads in the Android app.


First, add the below dependency in build.gradle(Module: App) for importing Facebook ads SDK.


Code:




And then move to the MainActivity.java file, take an InterstitialAd variable called interstitialAd.





After that, you have to initialize the SDK in Oncreate.








And then need to initialize that  InterstitialAd variable with your Interstitial Placement ID. Then load an ad.


Code:


Then you can setAdListener and call interstitialAd.show for showing your Interstitial Ad.


Code:




Then you call loadad() for loading an interstitial ad.



That's it. After publishing your app in the google play store, you will see your Interstitial ad is showing in your app. Thank you.

No comments:

Post a Comment