Last active
May 29, 2018 04:00
-
-
Save ShaishavGandhi/b8665312da68e27617ae4c28c46ca6ac to your computer and use it in GitHub Desktop.
Existing Native Content Ad API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AdLoader adLoader = new AdLoader.Builder(context, "ca-app-pub-3940256099942544/2247696110") | |
.forContentAd(new OnContentAdLoadedListener() { | |
@Override | |
public void onContentAdLoaded(NativeContentAd contentAd) { | |
// Show the content ad. | |
} | |
}) | |
.withAdListener(new AdListener() { | |
@Override | |
public void onAdFailedToLoad(int errorCode) { | |
// Handle the failure by logging, altering the UI, and so on. | |
} | |
}) | |
.withNativeAdOptions(new NativeAdOptions.Builder() | |
// Methods in the NativeAdOptions.Builder class can be | |
// used here to specify individual options settings. | |
.build()) | |
.build(); | |
adLoader.loadAd(new PublisherAdRequest.Builder().build()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment