admob_flutter icon indicating copy to clipboard operation
admob_flutter copied to clipboard

on setState method

Open glennmichaelmejias opened this issue 4 years ago • 6 comments

banner keeps on refreshing while calling setstate. how to prevent this? i have very low matched rate.

glennmichaelmejias avatar Aug 05 '19 14:08 glennmichaelmejias

I don't think there is a way to prevent this. @glennmichaelmejias Can you confirm @kmcgill88 ?

edeuss avatar Aug 05 '19 23:08 edeuss

@glennmichaelmejias to the best of my knowledge every time a render occurs a new banner view is created. I'd have to see your widget hierarchy but you will want to wrap the banner in your own stateful widget so it isn't rebuilt.

Admob best practice says basically keep the banner ad fixed to the top or bottom of the screen and the ad area should be fixed. Implementing this approach typically means only having 1 instance of the banner.

As an example, I've implemented this in a prior project, McAdViewController, which is a native AdMob solution for iOS. This keeps the single banner instance throughout the life of the app. Even when you transition to different screens.

I'm working on a project now that I'd like to implement this idea into admob_flutter since this is a common question here and I need it 😄.

@EliasDeuss what do you think about this idea? Instead of MaterialApp or CupertinoApp I plan on creating an AdmobApp or something like that, that will handle a single instance of the banner.

kmcgill88 avatar Aug 09 '19 02:08 kmcgill88

@glennmichaelmejias @EliasDeuss @YoussefKababe check out this proof of concept for keeping a single instance of your banner ad in an app. The state is kept at the very top of the app so it should never be re-rendered. Ads can just cycle through.

admobflutter

kmcgill88 avatar Aug 13 '19 03:08 kmcgill88

For feeds, the cool thing is that you have more than one ad. In my opinion, only a pinned ad can affect earnings, am I sure of that?

WygorFonseca avatar Aug 26 '19 13:08 WygorFonseca

Is the banner can create invalid impressions or invalid activity that can cause account to be suspended? I am afraid that this will create invalid impressions because of multiple banners in one app. I am also using this plugin with my app for more than 2 weeks and I can earned $10 with 50k impressions and 1.5k users/installs a day.

glennmichaelmejias avatar Aug 28 '19 09:08 glennmichaelmejias

image

image

just don't declare it inside a build function. it will just recreating every build function triggers or setState

eleomilagrosa avatar Nov 25 '19 05:11 eleomilagrosa