Webpop loading in its own window not in browser

Hi

I am trying to use the admob webhack again:(

local adSpace  
  
function showAd(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)  
 end  
 else  
 print("loading an ad")  
 return true  
 end  
end  
  
adSpace = native.showWebPopup(0, 0, 320, 48, "ad.html", {baseUrl = system.ResourceDirectory, hasBackground = false, urlRequest = showAd})  
  

It displays the ad in the small webPopup , but when you click the ad it opens in the small webpopup not the full screen browser, is this a bug?

[import]uid: 11459 topic_id: 6699 reply_id: 306699[/import]

This seems to be something that isn’t discussed much for some reason. Did you find a solution? [import]uid: 42417 topic_id: 6699 reply_id: 87940[/import]

This is not a bug. The web popup you are displaying is an actual web browser. Tapping links will naturally display the linked page within the same browser/web-popup.

Your sample code has the right idea. In your Lua listener, you need to call system.openURL() to show the tapped page as a separate activity using the Android device’s default web browser. You’ll also want to return false in this case to destroy the web view to prevent it from displaying that linked page within your own app. In which case you’ll need to create a new web view to “ad.html” again.

Does that make sense? [import]uid: 32256 topic_id: 6699 reply_id: 88172[/import]