Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to test Facebook Audience Network ads over TestFlight?

I am trying to integrate Audience Network to my app. Ads work correctly on simulator and device when I deploy over XCode.

I want to distribute the build over TestFlight to be sure it will work in release mode. When I try to directly deploy from XCode to my device in release mode, Facebook returns "No fill" for the Ads. Ads do not show up on TestFlight builds either.

Have any ideas about showing ads for devices in TestFlight builds?

like image 697
Luda Avatar asked Nov 25 '15 05:11

Luda


People also ask

How do I add a test device to my Facebook ads?

Add test devices either manually entering device IDs or by uploading a CSV. Enter the Google Advertising ID (AAID) for Android devices and the Identifier for Advertising (IDFA) for iOS devices and name each device. Once you have added a device you can Select Ad Type to be viewed on your device.

Can you test Facebook ads?

In addition to your ad elements, you can also test multiple target audiences or select additional Facebook ad testing ideas. If you don't have huge testing budgets, Facebook's campaign management options might do the job. You won't need them all too often as it takes time to gather relevant test results.


2 Answers

There could be two main reasons for this. Firstly, the user or testers could not be signed-in to the native Facebook app on the device. This could then result in Error 1001 - No Fill Rate.

1001 - No Fill

This is a common error seen while testing, and relates to a "No Fill" response; the most common reason for this is the user is not logged in to the Native Facebook App on a Test Device.

Server Response SDK Documentation Code=1001 “No Fill” Error 1001 - No Fill. Maybe due to one or more of the following:

  • User not logged into the Native Facebook App on Mobile Device
  • Limit Ad Tracking turned on (iOS)
  • No Ad Inventory for current user
  • Your testing device must have the native Facebook application installed.
  • Your application should attempt to make another request after 30 seconds.

This is what the documentation tells you for the 1001 error.

Secondly, you may still be in the debug mode and therefore you're not seeing ads in the release mode. To fix this error, download the newest provisioning profiles from the Apple Developer Center and toggle the Facebook App as released. You can do That by logging into the Facebook Developer console and selecting your app. Then on the left-hand side you should have this column, where you select STATUS & REVIEW. screenshot 1 Then, toggle the "Do you want to make this app public?" toggle to YES. Yes This will make your app available to anyone, meaning that the ads will pop up with all your testers.

My two cents from my experience here would be that you didn't make you app public or didn't have the users added as beta testers. Therefore facebook was unable to deliver any ads throwing the 1001 error. This should be a quick fix by making the app public and having your testers sign in through the facebook app. I had a similar problem with another part of the Facebook SDK, which got fixed by the public release.

Hope that helps, Julian

like image 64
Julian E. Avatar answered Sep 30 '22 15:09

Julian E.


If you have your ads in many places you can put this code in the AppDelegate

Swift 3

import FBAudienceNetwork

private func facebookAdsControl() {
    #if RELEASE
         self.clearTestDevicesForFacebookAds()
    #else
         self.addTestDevicesForFacebookAds()
    #endif
}

///remove for live mode
private func addTestDevicesForFacebookAds(){
    let key = FBAdSettings.testDeviceHash()
    FBAdSettings.setLogLevel(FBAdLogLevel.Log)
    FBAdSettings.addTestDevice(key)
}

///add for live mode
private func clearTestDevicesForFacebookAds() {
    FBAdSettings.clearTestDevices()
}

This code will make sure that your test ads show on testflight or the simulator/device and also will make sure when you release to the app store that your ads will be shown as LIVE ads and the test devices will be cleared.

call the: facebookAdsControl() in the didFinishLaunchingWithOptions

You can also call this code in the code where you have the ads but make sure you call it before adView.load()

In order to use the macro you have to add the flags to your Swift Flags in the Build Settings

I hope this helps someone as the Facebook Docs are not very clear as I have found out.

like image 37
stan Avatar answered Sep 30 '22 15:09

stan