I'm testing the webpopup on an iphone 3g. When an ad is clicked the webpopup displays fine, but when I hit the home button to close it, it closes the app also. I haven't ran into this problem on android, only iphone. Any suggestions? I'm using xcode 3.2.6, could that cause it?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | local function showAd_Apple(event) -- Is the url a remote call? if string.find(event.url, "http://", 1, false) == 1 then -- Is it a call to the admob server? if string.find(event.url, "c.admob.com", 1, false) == nil then adSpace.url = event.url else -- an actual click on an ad, so open in Safari system.openURL(event.url) -- Refresh ad RemoveAd(0) DisplayAd(0) end else -- Feb 1, 2011: if using the old version of this code, remove the -- following line: -- adSpace.url = event.url -- and put in this line instead: return true end end local adSpace = native.showWebPopup(0, 272, 320, 48, "ad.html", {baseUrl = system.ResourceDirectory, hasBackground = false, urlRequest = showAd_Apple}) |
The home button should always go to the "desktop" or "home" of the phone.
A solution might be having a popup slightly shorter than your screen height and putting a bar at the top or bottom with a button to close the popup?
Peach :)