PDA

View Full Version : Web Links in ST2 on iOS



wilzdezign
9 May 2012, 1:56 PM
I finally was able to go through the build and get the ST2 app on the iOS Simulator and iOS device, however now just noticing, any time I have a normal http web link in the app, it opens the web page within the application. The bad part about this, there is no back link and if I close the app and open, it still shows the web page.

When running in a web browser, setting the target="_blank" opens a new tab/window and I can browse the site and always get back to the mobile site. Once it is an "app" though, the target does not create a window outside the app but as a wrapped web view. Is there a way to make the links open outside the app? Or do I have to go through and remove all the web http links inside it?

I see someone else asked the same thing on stackOverflow (http://stackoverflow.com/questions/9941044/open-external-link-from-web-app-packaged-as-native-ios-app) with no solution either. Is it just not possible in the config when packaging as native for iOS to allow external web links open web browser?

wilzdezign
10 May 2012, 8:41 AM
Or is this something that is in future for the native command line packaging, allowing html links to open in external browser on the phone/tablet?

wilzdezign
11 May 2012, 10:23 AM
So for now, it looks like I will strip out any web links. The protocols mailto: and tel: work for emails and phones as the iOS handles that outside the app. However, http: links are shown as a WebView inside the app and then you lose the whole app from being used. If there was a way maybe to deliver the web link just within an iframe inside the ST2 app that could be an option, as long as there was a title bar with back button.

minamu1
15 Jun 2014, 12:13 PM
Hello,

Were you able to find a solution to this? Seems like a big problem; I'm running into this too. I have posted a thread of my own, hopefully someone will be able to help (http://www.sencha.com/forum/showthread.php?287089)

Thanks,

Mohammad
San Jose, CA

shepsii
20 Jun 2014, 2:38 AM
What you need to do, is use the inAppBrowser cordova plugin and open the links through there instead.

If you have hardcoded HTML links you can observe them being clicked, prevent the default and then open the A tag's href attribute in the inAppBrowser plugin.

See cordova's docs for more info.