Facebook Audience Network Library

Pendrush

Well-Known Member
Licensed User
Longtime User
Original library: https://developers.facebook.com/docs/audience-network/guides/adding-sdk/android
Based on Android Audience Network SDK 6.5.0 (17 May 2021)
Banner, Interstitial and Rewarded Video.

Library does not work anymore as Facebook ads must be served thorough mediation partners.
More info HERE.



For InterstitialAd and for RewardedVideoAd you need to add this in your manifest:
B4X:
AddApplicationText(<activity
            android:name="com.facebook.ads.AudienceNetworkActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:exported="false"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" />
        <provider
            android:name="com.facebook.ads.AudienceNetworkContentProvider"
            android:authorities="${applicationId}.AudienceNetworkContentProvider"
            android:exported="false" />)


Download library zip file from this link and extract archive to Additional Libraries folder. I'm not able to upload on forum, as size of file is over maximum allowed limit.

v6.00 - Manifest code changed.
v0.98+ - bring some breaking changes on Initialize method to support CCPA. Please check country and state parameters on Facebook (data processing options for CCPA)
 

Attachments

  • FBAudienceNetworkExample.zip
    16.9 KB · Views: 436
Last edited:

Douglas Farias

Expert
Licensed User
Longtime User
Hi @Pendrush.
How are your experience with facebook audience? this have a good revenue $ like admob ? have ads to all countrys?

thx
 

Pendrush

Well-Known Member
Licensed User
Longtime User
I don't have any experience with them.
You can't receive payment in every country, my country for example is not supported for payout, also app need to pass Facebook quality check.
As I found on reddit, for USA audience, audience network pays more for about 150% then admob.
You can check if your country is supported and try it in some of your apps.
Also, no ads if user is not logged in phone's Facebook app. Even test ad wont work.
 
Last edited:

Douglas Farias

Expert
Licensed User
Longtime User
Hi @Pendrush.
i m testing your example, thx for this.

i created a facebook audience account, completed my registration, added an app, it was approved, copied the banner and interstitial code and changed it in your example.

AdBanner.InitializeBanner ("AdBanner", "IMG_16_9_APP_INSTALL # YOUR_PLACEMENT_ID", AdBanner.AD_BANNER_HEIGHT_50)

I put my generated and it was something like that
AdBanner.InitializeBanner ("AdBanner", "IMG_16_9_APP_INSTALL # 291069155609476_29111..........", AdBanner.AD_BANNER_HEIGHT_50)

however the displayed ad is always the same
Facebook Test ad (install)
a real announcement is not shown, only the facebook test announcement.

my package name is correct, the banner code is correct, there are no errors, I have facebook installed and logged in, I really couldn't make your example work.

on the log show
Ad Loaded fired
Ad Logging Impression fired

Would you have any tips?

thank you
 

Attachments

  • WhatsApp Image 2020-06-19 at 16.11.57.jpeg
    53.6 KB · Views: 398

Pendrush

Well-Known Member
Licensed User
Longtime User
I'm not using Facebook Audience Network for my self, so I cant tell you for sure what could be.
I think error is here IMG_16_9_APP_INSTALL # 291069155609476_29111..........
PlacementID should be like 291069155609476_29111..... without IMG_16_9_APP_INSTALL # part.
"IMG_16_9_APP_INSTALL # " is used for test Ads only.
 

rubelrahman

New Member
Thanks for nice library, Working great. Is there any way to show ad to non loggedin user device.
Advance thanks for your kind co-operation..
 

madrigal

Member
Is there anyone who started making any profit from facebook using this library? because the testing worked with me but when im put the app on live mode it showed as if there are requests but there are no impressions so the ads did not show live, and its gave me a "no fill" error , does anyone have an idea about this problem and how to solve it ?
 

SMOOTSARA

Active Member
Licensed User
Longtime User
Cookies are required to use this site. You must accept them to continue using the site. Learn more…