Our application use Facebook Native Ad via mediation platform Mopub, and it works good, but we should move to another platform.
I've replaced SDK platform, using the same placementId and app_id and tested my application as Developer. Everything works good in test mode with real ads also, but I cannot get ads on real devices.
I tried to implement Facebook Native without any mediation platforms(code in the bottom), but still have the same result.
So the issue is not in partner platform,but I cannot get ads on real devices. Facebook Native throws error: 1001 no fill
It looks very strange, because I have:
- Application has real users and shows ads in the previous version.
- Application in PlayMarket(but with the previous implementation) with same package Id, placementId and app_id.
- Facebook has checked my app.
- I can see requests from new and previous version.
Code and logs: AndroidManifest: //...
//...
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="@string/app_id" />
Application build.gradle:
//...
ext {
supportLibraryVersion = '25.3.1'
playServicesVersion = '11.0.1'
FBVersion = "4.25.0"
}
dependencies {
compile project(':library')
compile fileTree(include: ['*.jar'], dir: 'libs')
//...
compile "com.facebook.android:audience-network-sdk:$FBVersion"
//...
}
FacebookNativeLoader.java:
//...
/**
* Initiate ad container for native ad
*/
Override
public View createContentView(Context context) {
log(" createContentView");
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
return inflater.inflate(R.layout.facebook_ad_native_view, null);
}
@Override
public void loadAd(final MyViewManager myViewManager, final ResultListener resultListener) {
log(" loadAd");
adNativeLayout = myViewManager.getContentView();
// Create ad request with Facebook ad PlacementId
adNative = new NativeAd(myViewManager.getContext(), adPlacementId);
//
adNative.setAdListener(new AdListener() {
@Override
public void onError(Ad ad, AdError adError) {
log("FacebookNative Ad Loading Failed." +
"Error:" + NATIVE_LOAD_ERROR +
" ErrorCode:" + adError.getErrorCode() +
" ErrorMessage" + adError.getErrorMessage());
//Call Error to hide ad layout
resultListener.onError(NATIVE_LOAD_ERROR);
}
@Override
public void onAdLoaded(Ad ad) {
log("FacebookNative Ad Loading Completed");
//...
// Download icon for native ad
if (adNative.getAdIcon() != null) {
String iconUrl = adNative.getAdIcon().getUrl();
if (iconUrl != null && iconUrl.length() > 0)
NativeAd.downloadAndDisplayImage(adNative.getAdIcon(), icon);
}
// Download cover for native ad
if (adNative.getAdCoverImage() != null) {
String coverUrl = adNative.getAdCoverImage().getUrl();
if (coverUrl != null && coverUrl.length() > 0)
NativeAd.downloadAndDisplayImage(adNative.getAdCoverImage(), contentImage);
}
//Show debug info
log("adNative.getCalltoAction() - " + adNative.getAdCallToAction());
log("adNative.getBody() - " + adNative.getAdBody());
log("adNative.getClickUrl() - " + adNative.getAdCallToAction());
BaseLockScreenManager.url = adNative.getAdCallToAction();
title.setText(adNative.getAdTitle());
text.setText(adNative.getAdSubtitle());
downloadButton.setText(adNative.getAdCallToAction());
// Add the AdChoices icon
LinearLayout adChoicesContainer = (LinearLayout) adNativeLayout.findViewById(R.id.ad_choices_container);
AdChoicesView adChoicesView = new AdChoicesView(myViewManager.getContext(), adNative, true);
adChoicesContainer.addView(adChoicesView);
//Call Success to show ads
resultListener.onSuccess(true);
}
@Override
public void onAdClicked(Ad ad) {
//Do something
}
@Override
public void onLoggingImpression(Ad ad) {
//Do something
}
});
//Register Ad container to catch user Interactions
adNative.registerViewForInteraction(adNativeLayout);
// Initiate a request to load an ad.
// Loading Ad started here...
adNative.loadAd();
}
In Facebook documentation "error: 1001 no fill" means:
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 Facebook App when testing your mobile app or not logged in to the Facebook mobile website when testing your mobile website.
Error 1001 - No Fill. May be due to one or more of the following: - User not logged into Native Facebook App on Mobile Device(But real device logged into Native Facebook App)
- Limit Ad Tracking turned on (iOS)(but this is not relevant for Android app)
- Opt out of interest-based ads turned on (Android) (but I've turned value off)
- No Ad Inventory for current user (What does it mean?)
- Your testing device must have the native Facebook application installed.(but I tested on real device with real Facebook account)
- Your application should attempt to make another request after 30 seconds.(but I'have the same result everytime)
LogCat messages:
Developer device:
FacebookLoader:
I/----FacebookLoader: loadAd
I/----FacebookLoader: createContentView
I/----FacebookLoader: Facebooknative Ad Loading Completed
I/----FacebookLoader: adNative.getCalltoAction() - Learn More
I/----FacebookLoader: adNative.getBody() - LAToken aims to tokenize assets worth $1.2 trillion by 2025.
I/----FacebookLoader: adNative.getClickUrl() - Learn More
User Device:
FacebookLoader:
I/----FacebookLoader: loadAd
I/----FacebookLoader: createContentView
I/----FacebookLoader: FacebookNative Ad Loading Failed.Error:669 ErrorCode:1001 ErrorMessage: No fill
What can be issue of it? Has somebody the same issue?
I'm afraid to make release without ability to be sure that user can see ads, because the main idea of our application is Advertisement.
step 1: goto play store download native Facebook app install and login
step 2: Then test your app "testing add loading success"
Other errors like : " FacebookAdapter: No fillI/TAG: No fill.I/Ads: Ad failed to load : 3" then : goto Manifest file and add on application level : android:usesCleartextTraffic="true"