Skip to content

Flutter - Facebook Audience Network Banner Ad Not loading, While Interestitial Ad Working fine #149

@fldvlpr

Description

@fldvlpr

Hey Folks,

@dreamsoftin @SachinGanesh

Recently, I was working on one of my mobile app and was trying to add facebook audience network plugin, But there is one strange issue is happening with my mobile app. I'm able to fetch interestitial app for facebook ads while banner ads are not loading in debug and release both mode. Following is my code, I've also cross verified my placement id for banner and interestitial ads.

bool isBannerAdLoaded = false;
  Widget bannerAdWidget = const SizedBox();

  void loadBannerAd() {
    debugPrint('facebook loadBannerAd called');
    bannerAdWidget = FacebookBannerAd(
      placementId: FbAdManager.getBannerAdUnitID(),
      bannerSize: BannerSize.STANDARD,
      listener: (result, value) {
        debugPrint('facebook loadBannerAd listener : ${result.toString()}');
        switch (result) {
          case BannerAdResult.ERROR:
            isBannerAdLoaded = false;
            debugPrint('Error: $value');
            break;
          case BannerAdResult.LOADED:
            setState(() {
              isBannerAdLoaded = true;
            });

            debugPrint('Loaded: $value');
            break;
          case BannerAdResult.CLICKED:
            debugPrint('Clicked: $value');
            break;
          case BannerAdResult.LOGGING_IMPRESSION:
            debugPrint('Logging Impression: $value');
            break;
        }
      },
    );
  }

  @override
  void initState() {
    super.initState();

    loadBannerAd();
  }

  @override
  Widget build(BuildContext context) {
    return isBannerAdLoaded ? bannerAdWidget : const SizedBox();
  }

I'm not getting any errors or logs. I've implemented the facebook ads many times in past. But this kind of issue never happened.

Let me know if there is anything if I'm missing.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions