title: Facebook Mediation for Android DFP SDK
body: <p>I integrated Facebook Audience Network and Facebook Adapter from here: <a href="https://bintray.com/google/mobile-ads-adapters-android/com.google.ads.mediation.facebook#read" rel="nofollow noreferrer">https://bintray.com/google/mobile-ads-adapters-android/com.google.ads.mediation.facebook#read</a></p>
  
  <p>Then as it's in the instructions on the link I used this code to set up the PublisherAdView. (cube3 is a banner)</p>
  
  <pre><code>Bundle extras = new FacebookAdapter.FacebookExtrasBundleBuilder()
      .setNativeAdChoicesIconExpandable(false)
      .build();
  cube3= (PublisherAdView) findViewById(R.id.cube3);
  PublisherAdRequest cubeRequest3 = new PublisherAdRequest.Builder()
              .addNetworkExtrasBundle(FacebookAdapter.class, extras)
              .build();
  cube3.loadAd(cubeRequest3);
  cube3.setAdListener(new AdListener() {
          @Override
          public void onAdFailedToLoad(int i) {
              super.onAdFailedToLoad(i);
              cube3.setVisibility(View.GONE);
              Log.v("FAILED", "TO LOAD@@");
          }
  
          @Override
          public void onAdLoaded() {
              super.onAdLoaded();
              cube3.setVisibility(View.VISIBLE);
          }
      });
  </code></pre>
  
  <p>But the Ad Mediation isn't working. 
  In the log I am getting:</p>
  
  <blockquote>
    <p>W/FacebookAdapter: (#200) Permissions error</p>
    
    <p>I/Ads: No fill from any mediation ad networks.</p>
    
    <p>FAILED: TO LOAD@@ (which I set up in the code to appear if not loaded)</p>
  </blockquote>
  
  <p>How to make the mediation work?</p>
  
  <hr>
  
  <p>Update:
  So I added the AdSettings. addTestDevice("HASH"); code, and now the test ad is appearing saying Your Ad Integration works and the log is saying that the impression is being logged. However on the facebook audience panel there are still no registered impressions so I can't approve the app. What do I need to do for facebook to register the impressions?</p>