dreamsoftin / facebook_audience_network

Flutter Facebook Audience Network
https://pub.dartlang.org/packages/facebook_audience_network/
MIT License
156 stars 99 forks source link

Remove blank black color #6

Closed karnadii closed 5 years ago

karnadii commented 5 years ago

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.

SurajShettigar commented 5 years ago
  1. The background color of Native Ads can be changed through backgroundColor property of FacebookNativeAd widget.

  2. 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.

  3. 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.

karnadii commented 5 years ago

@SurajShettigar

  1. I am seeing some black/grey color before the ad is loaded
SurajShettigar commented 5 years ago

Can you show the code snippet of the Ad?

karnadii commented 5 years ago
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?

SurajShettigar commented 5 years ago

I don't think it is a plugin issue because nowhere i have set the background color as grey.

native

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.

karnadii commented 5 years ago

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.

john990 commented 3 years ago

I meet same problem.