flutter_google_ad_manager icon indicating copy to clipboard operation
flutter_google_ad_manager copied to clipboard

BottomNaviagation onTap conflict

Open besho opened this issue 5 years ago • 9 comments

I have a big issue that my app has BottomNaviagation and once i tapped on any item and the current Widget has DFPAdBanner partially appear on screen and the other under the BottomNaviagation onTap open DFPAdBanner click url of ads opened. this issue happened on iOS devices only. please check screenshot.

besho avatar Sep 29 '19 15:09 besho

@besho I see it is the same as the https://github.com/ko2ic/flutter_google_ad_manager/issues/15 issue.

ko2ic avatar Sep 29 '19 17:09 ko2ic

No, it isn't the same. i attached a screenshot. in case i clicked on any navigationBotton tab, the ad's click url opened in browser 70477382_511504772749182_8272576336057335808_n

besho avatar Sep 29 '19 17:09 besho

@besho It seems the same to me. Can I try the Visibility widget?

ko2ic avatar Oct 02 '19 14:10 ko2ic

@besho Today i'm facing the same problem. If the banner is behind the bottombar and you click on a bottombar item the link opens.

I dont know how to fix this with visibility. I haven't tried with the Stack class yet.

cschellhas avatar Mar 31 '20 13:03 cschellhas

Hi @cschellhas

I fixed this issue by workaround solution for iOS Platforms only .I used VisibilityDetector to detect if the Ad-banner is fully visible or not and in case fully visible i show the ad-banner and in case not fully visible i hide the ad-banner. I will share with you the code below:-

double visibleFraction = 0; Container buildAdBanner() { return Platform.isAndroid ? Container(child:AddDFPBanner()) : Container(child: VisibilityDetector( key: Key("banner"), onVisibilityChanged: (VisibilityInfo info) { setState(() { visibleFraction = info.visibleFraction; }); }, child: Stack( children: <Widget>[ Center( child: Visibility(child: AddDFPBanner(),visible: visibleFraction ==1 ? true:false,), ), visibleFraction < 1.0 ? Center ( child: Container( height: 250, width: 300, ), ):Container() ], ))); }

Hope you try it and let me know your feedback

BeshoyAdelHemaya avatar Mar 31 '20 13:03 BeshoyAdelHemaya

Hi @cschellhas

I fixed this issue by workaround solution for iOS Platforms only .I used VisibilityDetector to detect if the Ad-banner is fully visible or not and in case fully visible i show the ad-banner and in case not fully visible i hide the ad-banner. I will share with you the code below:-

double visibleFraction = 0; Container buildAdBanner() { return Platform.isAndroid ? Container(child:AddDFPBanner()) : Container(child: VisibilityDetector( key: Key("banner"), onVisibilityChanged: (VisibilityInfo info) { setState(() { visibleFraction = info.visibleFraction; }); }, child: Stack( children: [ Center( child: Visibility(child: AddDFPBanner(),visible: visibleFraction ==1 ? true:false,), ), visibleFraction < 1.0 ? Center ( child: Container( height: 250, width: 300, ), ):Container() ], ))); }

Hope you try it and let me know your feedback

Thank you very much. That solved it.

cschellhas avatar Apr 01 '20 13:04 cschellhas

Great

BeshoyAdelHemaya avatar Apr 01 '20 13:04 BeshoyAdelHemaya

@BeshoyAdelHemaya

Hi just want to say, it seems to be fixed in Flutter 1.20.1. Bottomnavigation works normal in my iOS App now.

Can you confirm?

cschellhas avatar Aug 13 '20 08:08 cschellhas

I will check it and feedback you. Is it working with you ?

BeshoyAdelHemaya avatar Aug 13 '20 08:08 BeshoyAdelHemaya