Closed karnadii closed 5 years ago
The background color of Native Ads can be changed through backgroundColor
property of FacebookNativeAd
widget.
You can implement your own loading indicator and show and hide the indicator based on listener result. For example:
FacebookNativeAd(
adType: NativeAdType.NATIVE_AD,
width: double.infinity,
height: 300,
backgroundColor: Colors.blue,
listener: (result, value) {
if(result == NativeAdResult.LOADED)
showProgress = false;
},
);
Then based off of showProgress
value, you could show or hide a progress indicator widget.
I am not exactly clear on what you mean when you say that Ads won't show if Facebook app is not installed. I don't think you need Facebook app installed on the device to use Facebook Audience Network monetization for your app.
@SurajShettigar
Can you show the code snippet of the Ad?
Container(
margin: EdgeInsets.only(bottom: 10.0),
child: FacebookNativeAd(
placementId: "YOUR_PLACEMENT_ID",
adType: NativeAdType.NATIVE_BANNER_AD,
bannerAdSize: NativeBannerAdSize.HEIGHT_100,
width: double.infinity,
backgroundColor: Colors.white,
titleColor: Colors.black,
descriptionColor: Colors.grey,
buttonColor: Colors.blue,
buttonTitleColor: Colors.white,
buttonBorderColor: Colors.white,
listener: (result, value) {
print("Native Ad: $result --> $value");
},
),
),
almost the same with your example, is this flutter issue and not his plugin?
I don't think it is a plugin issue because nowhere i have set the background color as grey.
As you can see in the above gif, the buttons momentarily are grey in the beginning and then set to the custom color. So i think Facebook Audience Network API is handling the color before it sets our custom color. And that is beyond our scope.
I have tested in 2 different devices, it appears only in certain device only, and I also tested, FAN will show ads only if facebook apps is installed in the devices.
I meet same problem.
Thanks for the plugin, I have been waiting for admob alternatif plugin for flutter,
Can the blank black color in native ads changed with custom color or a loading indicator / shimmer before the ad is loaded? And what if the device doesnt have facebook installed? The ad wont show, so it would be good if there is a fallback view instead showing blank black space.