I want to put iAd & adMob ads together with my webView.
Since webView can only be on the top, therefore I need to calculate the exact height for the webView and leave the rest space for iAd/adMob ad.
For example, if the ad height is stored in “theAdHeight” in the code below, then I can create a webView like this (so the ad plus the webView can occupy the whole screen seamlessly)
local screenW, screenH = display.contentWidth, display.contentHeight local topY = display.screenOriginY local leftX = display.screenOriginX local trueW = rightX -leftX local trueH = bottomY - topY local theAdHeight = ???????? webView = native.newWebView(leftX, topY, trueW, trueH - theAdHeight)
In my config.lua, I use 320x480 letterbox. (Portrait mode)
So about the ad height, here are my experiment results:
(1) iAd + iPad 4, theAdHeight = 31 (how do I get this number? I don’t know, because I adjusted one pixel at a time to get this number)
(2) iAd + iPhone 5S, theAdHeight = 50 (I guessed right because the Apple doc says the ad is 320x50 points)
(3) adMob + iPad 4, theAdHeight = 42 (adjusted one pixel a time to get this number)
(4) adMob + iPhone 5S, theAdHeight = 50 (I guessed right because adMob doc says the ad is 320x50 for phones)
So my questions are:
a. how these two numbers 31 & 42 are calculated? anyone knows about the formula?
b. what about other devices? I don’t have iPhone 4/4S or iPad mini to test. How do I get the ad height for these devices?
c. are these ads fixed size? I saw somewhere saying that Corona use “smart banner” for admob… which means the height might not be fixed?
I have been testing iAd/adMob these three days. Since it cannot be tested in the simulator, it’s really time consuming. And the result is very unpredictable. (Besides this, there was another problem about placing the ad at the bottom of the screen that I have been asking in another thread. And this problem can extend to Android devices, but I want to forget Android devices for now, because it’s already too complicated with iOS devices)
I really hope someone who have been through this can share some thoughts. And, please Corona staff can help this regard. I feel so dizzy now.