How to move a banner?

I would like to know how to move an admob banner when it is displayed on the screen?

It is that possible?

Hi @florca,

No, you can’t move a banner once it’s displayed. You’d need to hide it and place a new one, but I suppose that’s not what you want. :slight_smile:

Brent

I have in my game a RPM of 0.01€ so… yeah I am trying new things hehe  :o

Thank you for your answer Brent! Corona devs helping users in the forum is really really cool.  ;)  :stuck_out_tongue:

You may want to checkout ads.height() feature. You can get the height of the advertisement, then hide it. Then use that height in some calculation, to show a new advertisement. Hope this helps.

My issue with admob banners is that every time I call show.ads() and then hide.ads(), the next time I call again show.ads() the banner restart itself.

It is not like doing ads.isVisible = false, it is a new call to the admob server, and that is really slow. I need to hide and show the banner instantly, but I can’t right now because of that.  :mellow:

That is my problem with admob banners and show/hide functions.

What is the reason you need to move the ads after it’s shown, if you post that, we can suggest some ways to do at the very least, a workaround

The reason is that I would like to hide and show ads with admob but right now it is really slow. It is not like doing ads.isVisible = false, and then ads.isVisible = true. It is a new call to the admob server, and that is really slow. I need to hide and show the banner instantly, but I can’t right now because of that. 

iAds seems to be working perfect, being really quick on showing and hiding themselves.

Hi @florca,

No, you can’t move a banner once it’s displayed. You’d need to hide it and place a new one, but I suppose that’s not what you want. :slight_smile:

Brent

I have in my game a RPM of 0.01€ so… yeah I am trying new things hehe  :o

Thank you for your answer Brent! Corona devs helping users in the forum is really really cool.  ;)  :stuck_out_tongue:

You may want to checkout ads.height() feature. You can get the height of the advertisement, then hide it. Then use that height in some calculation, to show a new advertisement. Hope this helps.

My issue with admob banners is that every time I call show.ads() and then hide.ads(), the next time I call again show.ads() the banner restart itself.

It is not like doing ads.isVisible = false, it is a new call to the admob server, and that is really slow. I need to hide and show the banner instantly, but I can’t right now because of that.  :mellow:

That is my problem with admob banners and show/hide functions.

What is the reason you need to move the ads after it’s shown, if you post that, we can suggest some ways to do at the very least, a workaround

The reason is that I would like to hide and show ads with admob but right now it is really slow. It is not like doing ads.isVisible = false, and then ads.isVisible = true. It is a new call to the admob server, and that is really slow. I need to hide and show the banner instantly, but I can’t right now because of that. 

iAds seems to be working perfect, being really quick on showing and hiding themselves.

This turns out to be a bit of a problem when you want to anchor the banner ad to the bottom of the screen.

You don’t really know before hand the height of the ad that is going to be served to you because this changes depending on the device and because the admob corona plugin uses smart banners. I’ve found that I have to reserve a certain amount of space in my layout (100px) at the bottom to ensure the ad won’t cover my UI. The problem is when admob serves me an ad with a height less than 100px. This ends up leaving a space where content shows through between the bottom of the ad and the bottom of the screen (such as my background image!).

As florca stated, showing the ad, getting the height, hiding the ad, then showing the ad with a new position based on the ad height could be a workaround, except it has a lot of negative side effects:

  1. It will be slow since when you show the ad, hide the ad, and show the ad again there is a new request made to admob over the network everytime you call ad.show.

  2. It will drain a user’s battery faster because of the extra network requests.

  3. It tanks your ECPM because you are showing an ad, immediately hiding it, and immediately requesting a new ad. The user never has a chance to really see or click the first ad so this will effectively bottom out your ECPM and screw up all your ad reporting.

Corona, can you please just provide an accessor method to move the banner around after it has been shown?

This will allow developers to anchor their ads to the bottom of the screen without the negative side effects I stated above.

Thanks!

This turns out to be a bit of a problem when you want to anchor the banner ad to the bottom of the screen.

You don’t really know before hand the height of the ad that is going to be served to you because this changes depending on the device and because the admob corona plugin uses smart banners. I’ve found that I have to reserve a certain amount of space in my layout (100px) at the bottom to ensure the ad won’t cover my UI. The problem is when admob serves me an ad with a height less than 100px. This ends up leaving a space where content shows through between the bottom of the ad and the bottom of the screen (such as my background image!).

As florca stated, showing the ad, getting the height, hiding the ad, then showing the ad with a new position based on the ad height could be a workaround, except it has a lot of negative side effects:

  1. It will be slow since when you show the ad, hide the ad, and show the ad again there is a new request made to admob over the network everytime you call ad.show.

  2. It will drain a user’s battery faster because of the extra network requests.

  3. It tanks your ECPM because you are showing an ad, immediately hiding it, and immediately requesting a new ad. The user never has a chance to really see or click the first ad so this will effectively bottom out your ECPM and screw up all your ad reporting.

Corona, can you please just provide an accessor method to move the banner around after it has been shown?

This will allow developers to anchor their ads to the bottom of the screen without the negative side effects I stated above.

Thanks!