30 Mar 2012 2:12 AM #1
Unanswered: Open link in Safari from iOS packaged App
I have a link on my mobile app with a target="_blank" attribute. The app is packaged as a native iOS app. The problem is, the link is not opening in Safari as expected, instead it opens inside the app. It is very important that the link opens in Safari in a new browser window. How can I achieve that?
2 Apr 2012 6:38 PM #2
3 Apr 2012 12:09 AM #3
How to do that? Can you point me to the documentation?
11 May 2012 9:05 AM #4
I would love to know that too.
A part of our app is opening a PDF, and when opened (in webview obviously) there is no possible way of getting back than deleting app from memory.
Has anybody found a hack?
@sencha are you looking into this in any way already?
11 May 2012 9:53 AM #5
I ended up using Phonegap (now Cordova) for packaging. You can modify the view controller to allow opening of links outside of the app.
30 May 2012 12:10 PM #6
- Join Date
- Mar 2007
- Melbourne, Australia (aka GMT+10)
- Vote Rating
6 Jun 2012 6:00 AM #7
Opening a PDF from a native package app is really important.
There is many people asking about open links (external pages or pdf files) so Sencha, please recognize it's importance and look for a solution for 2.0.x
I still have 3-5 weeks before production, but for now it looks like I should abandon the sencha packaging av look for PhoneGap/Cordova.
I've looked at a few solutions, some people try the iframe support. Many get problems scrolling but it looks like making a really, really, large iframe that includes the PDF can be a "solution"
Also, there is a ux for using target: _blank on a click event, but I can't see that this would be better than target="_blank" in the a tag. (read: not working)
http://www.sencha.com/forum/archive/.../t-129038.htmlSven Tore Iversen
6 Jun 2012 7:01 AM #8
This is definitely something I'm very interested in. Displaying PDF's is critical to our application and if we can't do it from Touch we'll have to use a different solution.
22 Dec 2013 11:27 PM #9
dunno what exactly you mean by iso packaged app (I'm currently confused with sencha native packager and phonegap, cordova packager).
If you use phonegap/cordova,just open
Xcode -> click the folder icon -> resources -> config.xml
inside the plugins tag add the following line:
<plugin name="InAppBrowser" value="CDVInAppBrowser" />
window.open("http://www.yoururlgoeshere.com", "_system"); //second parameter tell phonegap to open the url on device browser
3 values for the second parameter and its explanation:
- _self - opens in the Cordova WebView if url is in the white-list, else it opens in the InAppBrowser
- _blank - always open in the InAppBrowser
- _system - always open in the system web browser
Last edited by =NR=; 23 Dec 2013 at 12:25 AM. Reason: formatting the text