Keeping adMob to the bottom of screen across platform.

dsmystic, the problem I had was that the adMob object uses different reference point on the different platforms, so no general code can solve this problem until the corona team makes the object act the same on the different platforms, instead we need to have a different code for each OS in order for the ad object to be at the right place each time.

Hi formatc

i use :

local environment = system.getInfo( "platformName" ) if environment == "Mac OS X" then     print( "You're in the simulator." ) end if environment == "iPhone OS" then     ads.show( "banner", { x=display.screenOriginX, y=390 } ) end if environment == "Android" then     ads.show( "banner", { x=display.screenOriginX, y=440 } ) end

If you want AdMob ads (and I think it works for iAds too) to be at the bottom, set the y value to something really large, like 100000 and the code will put it back on the page anchored to the bottom.

Rob

Yet again, this code is very narrow, it’s good only for 2 specific “sizes” of screens, or stages, I want, and need, something that will always work, no matter screen size or resolution.

Seems to work! but still, I don’t normally love to user workarounds, I rather have something work right in its own self…, but thanks for the makeshift solution!

Actually this isn’t as makeshift as it sounds.  The Ad providers take precautions to make sure you don’t ask for ads and not show them. The code makes sure your ad will be on the screen.   By specifying an off screen value, the ad code takes care of putting it back on the screen at the bottom.

Rob

Are we sure this type of fix does not get reported to the ad provider to flag us as a user who tries to show their ads off screen?

What file do you have to edit to make this y change?

You do it where ever you are calling ad.show(“banner”, …)

Rob

Ive been struggling with getting something to stick to the bottom of the screen as well. I havent tested this on actual devices but it works on the simulator. Let me know how it works for you.

-- can be a rectangle or container or anything local dispObj = display.someKindOfNewShape -- set the anchor to top-left dispObj.anchorX = 0 dispObj.anchorY = 0 -- y position... -- contentHeight + absolute value of origin, since it will be negative... minus the height of the object itself (keep in mind the origin of the object is now at top-left) dispObj.y = (display.contentHeight + math.abs(display.screenOriginY)) - dispObj.contentHeight

dsmystic, the problem I had was that the adMob object uses different reference point on the different platforms, so no general code can solve this problem until the corona team makes the object act the same on the different platforms, instead we need to have a different code for each OS in order for the ad object to be at the right place each time.

Hi formatc

i use :

local environment = system.getInfo( "platformName" ) if environment == "Mac OS X" then     print( "You're in the simulator." ) end if environment == "iPhone OS" then     ads.show( "banner", { x=display.screenOriginX, y=390 } ) end if environment == "Android" then     ads.show( "banner", { x=display.screenOriginX, y=440 } ) end

If you want AdMob ads (and I think it works for iAds too) to be at the bottom, set the y value to something really large, like 100000 and the code will put it back on the page anchored to the bottom.

Rob

Yet again, this code is very narrow, it’s good only for 2 specific “sizes” of screens, or stages, I want, and need, something that will always work, no matter screen size or resolution.

Seems to work! but still, I don’t normally love to user workarounds, I rather have something work right in its own self…, but thanks for the makeshift solution!

Actually this isn’t as makeshift as it sounds.  The Ad providers take precautions to make sure you don’t ask for ads and not show them. The code makes sure your ad will be on the screen.   By specifying an off screen value, the ad code takes care of putting it back on the screen at the bottom.

Rob

Are we sure this type of fix does not get reported to the ad provider to flag us as a user who tries to show their ads off screen?

What file do you have to edit to make this y change?

You do it where ever you are calling ad.show(“banner”, …)

Rob

How can I move buttons from the bottom up exactly the value of the banner.hight? How can I get the size (height) of the banner ad, so I can make the needed changes for the screen layout?