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 for iOS #47

Closed appycamper closed 3 years ago

appycamper commented 4 years ago

I tried adding native banner for iOS but not receiving any ads. Is this currently supported? Using v0.6.2

FacebookNativeAd(
                placementId: AdProvider.nativeBannerId,
                adType: NativeAdType.NATIVE_BANNER_AD,
                bannerAdSize: NativeBannerAdSize.HEIGHT_50,
                height: AdProvider.bannerHeight,
                width: double.infinity,
                backgroundColor: TGColors.adGray,
                titleColor: TGColors.gray,
                descriptionColor: TGColors.gray,
                buttonTitleColor: Colors.white,
                buttonColor: TGColors.darkBlue,
                buttonBorderColor: TGColors.darkBlue,
                expandAnimationDuraion: 200,
                keepExpandedWhileLoading: false,
              ),
SachinGanesh commented 4 years ago

Try with Test ID's

appycamper commented 4 years ago

I've added my iPhone's Identifier for Advertising (IDFA) as explained here

How do you obtain the hashed id for testing for iOS devices? they only show up on Android so I have nothing to put in as testingId

FacebookAudienceNetwork.init(
  testingId: "what do you put here for iOS devices"
);
SachinGanesh commented 4 years ago

Replace your PLACEMENT_ID with IMG_16_9_APP_INSTALL#PLACEMENT_ID. You should get test ads.

Follow the instructions in this link to test the ads: https://developers.facebook.com/docs/audience-network/guides/test/inserted-code/

mhle commented 4 years ago

The issue is using

keepExpandedWhileLoading: false

does not work for iOS, as there will be a white area where the banner should show up.

After removing that line, the test banner will show up correctly.

Hope you can update the docs accordingly.

appycamper commented 4 years ago

@mhle Thanks that works! @SachinGanesh are you aware the stylings for native banner on iOS does not work? For example

backgroundColor: Colors.green

does not work. It works on Android though.