dreamsoftin / facebook_audience_network

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

Native Banner Ad blank space if Ad not loaded #34

Closed Omi231 closed 4 years ago

Omi231 commented 4 years ago

The fill rate inside my app is less than 30% these days thats why most of the users see a blank space instead of ad. Is there any way i can show a custom ad to promote my other app or atleast hide that blank space?

This is the sole reason I have removed native banner ads from the app for now because the empty space make the UI look ugly :(

SachinGanesh commented 4 years ago

Hi, Thank you for the feedback. We have added a feature to collapse the empty ad space and expand it only if the ad is loaded. We will be pushing the update in a day to two.

Omi231 commented 4 years ago

@SachinGanesh Thank you so much. Waiting for the update...

SachinGanesh commented 4 years ago

Hi. This feature is now available through ios branch. If everything works fine we will release it through pub.dev

You can use the below dependecy to test the integration

facebook_audience_network: 
    git: 
      url: git@github.com:dreamsoftin/facebook_audience_network.git
      ref: ios
Omi231 commented 4 years ago

Hi, the ios branch package is adding ~200% blank space below the NativeBanner.

henoktadesse commented 4 years ago

I was using page view (one item per page) so the collapse feature wasn't as useful for me but I came with this using stack, you can put loading behind the native ad so when the ad finishes loading it covers the loading progress indicator.

                Stack(
                  children: [
                    Align(alignment : Alignment.center,child: CircularProgressIndicator()),
                    FacebookNativeAd(
                      placementId: "placement_id",
                      adType: NativeAdType.NATIVE_AD,
                      width: double.infinity,
                      height: MediaQuery.of(context).size.height/2,
                      backgroundColor: Colors.white,
                      titleColor: Colors.black87,
                      descriptionColor: Colors.black87,
                      buttonColor: Colors.deepOrange.withOpacity(0.6),
                      buttonTitleColor: Colors.white,
                      buttonBorderColor: Colors.deepOrange,
                      keepAlive: true, 
                      keepExpandedWhileLoading: false,
                      expandAnimationDuraion: 300, 
                      listener: (NativeAdResult result, value) {
                        print("Native Ad: $result --> $value");
                      },
                    ),
                  ],
                )
Omi231 commented 4 years ago

@henoktadesse What about Native Banner ads? After the update, native banner ads add some extra space under the ad. I am not able to understand the reason.

SachinGanesh commented 4 years ago

@Omi231 Please share a screenshot to show the issue

Omi231 commented 4 years ago

I fixed it by passing height property in NativeAd() widget. This is not mentioned in documentation.

Thank you for the good work. Please improve expandAnimation if possible. It looks glitchy thats why I opted to not use it.

Stay blessed!