-
Notifications
You must be signed in to change notification settings - Fork 99
Open
Description
Hey Folks,
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
mtalha101 and HussainTaj-W
Metadata
Metadata
Assignees
Labels
No labels