I’ve seen this problem mentioned before, but couldn’t find a solution.
I’m trying to build a “more apps” page inside my app. The page is a local html file that mimics a tableview with links to my other apps on the appstore.
The problem is that after clicking one of those links, the app tries to load the app store webpage inside the webpopup. I tried using target = “_blank” in my html links, but that has no effect.
This is my implementation so far, which I got by reading the current posts about this subject:
local function listener( event )
local shouldLoad = true
local url = event.url
if string.find(url,"&\_blank") then
system.openURL( url )
shouldLoad = false
end
return shouldLoad
end
--show web popup
local webPopupOptions = {autoCancel = false, urlRequest=listener,webPopupOptions.baseUrl=system.ResourceDirectory }
native.showWebPopup( scr.originX, scr.originY, scr.width, scr.height-44, url, webPopupOptions);
At the end of each ‘href’ address in the html file I added the string ‘&_blank’ to identify it as its supposed to open externally.
This in fact opens the link externally (thanks to system.openURL), but introduces a new problem: the link tries to load in both Safari and in the webpopup. I only want it to open in Safari.
How do you properly open links externally through a webpopup? [import]uid: 33608 topic_id: 26725 reply_id: 326725[/import]