Facebook Audience Network Ads API
Show Facebook Audience Network banner and interstitial ads in your WebViewGold Android app.
The Facebook Audience Network allows mobile app developers to monetize iOS and Android applications by displaying ads. Through WebViewGold, you can easily incorporate Facebook ads into your WebView-based Android app to earn revenue through clicks (CPC) and impressions (CPM).
Step 1: Open the Config.java File
- To begin, open your app's Config.java file to configure the Audience Network settings.
Step 2: Enable Facebook Audience Network Ads
- Activate Necessary Configuration Variables:
- Set the following variables to
truein Config.java:USE_FACEBOOK_ADSsets the app to use Facebook Audience Network ads instead of AdMob ads.SHOW_BANNER_ADturns on banner ads for your app.SHOW_FULLSCREEN_ADturns on fullscreen, interstitial ads for your app.
- Set
SHOW_AD_AFTER_Xto a desired number of website clicks to show an interstitial ad.
- Set the following variables to
- Enter Your Facebook Ad IDs:
- Go to
strings.xmland add your unique Facebook Ad IDs to the corresponding fields.
- Go to
After configuring the above settings and confirming your Ad IDs, your app is now ready to launch with Facebook Audience Network ads enabled.
For further details, you may also refer to the official Facebook Audience Network documentation for any additional setup or optimization tips specific to your ad strategy.
You can also dynamically control the ad visibility for a user by calling the following custom URL schemes from your website or app:
enableads://– Set ads to be shown again for the current userdisableads://– Permanently disables ads for the current user
<a href="enableads://">Enable Ads</a>
<a href="disableads://">Disable Ads</a>