Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook Audience Network returns error "Ad was re-loaded too frequently"

I try to add Facebook banner to my Android App. It works good with my LG D-405, but returns "Ad was re-loaded too frequently" with Samsung Galaxy S5.

adView = new AdView(getActivity(), "-------", AdSize.BANNER_HEIGHT_50);
        adView.setAdListener(new AdListener() {
            @Override
            public void onError(Ad ad, AdError adError) {
                if(getActivity()!=null) {
                    ((MyApplication) getActivity().getApplication()).getDefaultTracker().send(
                            new HitBuilders.EventBuilder()
                                    .setCategory("Facebook AdView")
                                    .setAction("error")
                                    .setLabel(adError.getErrorMessage())
                                    .setValue((long) adError.getErrorCode())
                                    .build()
                    );
                }
            }

            @Override
            public void onAdLoaded(Ad ad) {
                if(!layout.getChildAt(2).equals(adView)) {
                    layout.addView(adView, 2, new LinearLayout.LayoutParams((int) (AdSize.BANNER_HEIGHT_50.getWidth() * MainActivity.density), (int) (AdSize.BANNER_HEIGHT_50.getHeight() * MainActivity.density)));
                }
            }

            @Override
            public void onAdClicked(Ad ad) {

            }
        });
        //adView.disableAutoRefresh();
        adView.loadAd();
like image 659
Viktor Sinelnikov Avatar asked Sep 24 '15 23:09

Viktor Sinelnikov


People also ask

Is Facebook Audience Network shutting down?

Facebook decided to shut down its mobile web and in-stream placements because they want to focus their resources on mobile apps exclusively. A statement from them says: We've made this decision based on where we see growing demand from our partners, which is in other formats across mobile apps.

When testing your app with Facebook's ad units you must specify the device hashed ID to ensure the delivery of test ads?

When testing your app with Facebook's ad units you must specify the device hashed ID to ensure the delivery of test ads, add the following code before loading an ad: AdSettings. addTestDevice("328404cebf50ec1fdb05795c0007a8a7"); Save this answer.


3 Answers

I too got the same issue and the it seems that you must have the Facebook app installed on the device and have logged in within the last 30 days.

Also, I found this - https://developers.facebook.com/docs/audience-network/faq#a12

Source

like image 163
Atul O Holic Avatar answered Sep 22 '22 23:09

Atul O Holic


Here is the solution if you are using emulator:

  1. in logcat search for AdSettings.addTestDevice. You will find something like "AdSettings.addTestDevice("3b656c58-53ab-43a8-a0d6-d1f82abdf251");"
  2. Copy this line to your code.

You are done.

like image 44
صلي علي محمد Atef Farouk Avatar answered Sep 24 '22 23:09

صلي علي محمد Atef Farouk


According to facebook's documentation, ad request frequency has certain limit and you should wait 30 minutes before making an other ad request if you received this error.

Code=1002 “Load Too Frequently”
Ad Requests are based on a combination of:
Device ID
Placement ID
Display Format (Banner, Interstitial, Native)
Your application should attempt to make another request after 30 minutes. We also suggest adjusting your Refresh Rate or Request Rate.

like image 37
kubrick G Avatar answered Sep 21 '22 23:09

kubrick G