Page 2 of 5

Open Links in Safari (iOS)/Native Browser

Posted: Mon Feb 03, 2014 11:22 pm
by Nathan Friend

Ah yes, that would not be possible in your case.


Open Links in Safari (iOS)/Native Browser

Posted: Tue Feb 04, 2014 1:42 am
by Nathan Friend

To create a result similar to using the Navigate to link function inside of an onclick event, use the following.

window.open(url, "_blank");

Opens the browser inside of the application window with a done button at the bottom to close the browser window.

Tested in IOS only.


Open Links in Safari (iOS)/Native Browser

Posted: Sun Apr 20, 2014 4:52 am
by Matt6607699

This is totally not working for me for some reason.

I am using:
window.open(URL, '_system', 'location=yes');

also tried:
window.open(URL, '_system');

The link always opens in the app browser with no way to close it or go back.
this is on the xcode ios simulator and downloaded from xcode to phone/ipad.


Open Links in Safari (iOS)/Native Browser

Posted: Sun Apr 20, 2014 10:25 pm
by Illya Stepanov

Hi Matt - Where you want to open the link? What version of iOS you are using?


Open Links in Safari (iOS)/Native Browser

Posted: Sun Apr 20, 2014 10:43 pm
by Matt6607699

I want to open the link in the safari browser. I've tried it on iphone ios 7.0.4 and ipad 7.0.6 with no luck. The _system target doesn't seem to work for me.


Open Links in Safari (iOS)/Native Browser

Posted: Mon Apr 21, 2014 12:22 am
by Illya Stepanov

Can you show how exactly you're using this code? It works for me as expected (iOS7.1).


Open Links in Safari (iOS)/Native Browser

Posted: Mon Apr 21, 2014 1:09 am
by Matt6607699

On a button click I have a Run Javascript event:

codevar URL = localStorage.getItem('local_connection_URL');
var Status = localStorage.getItem('connection_status');
if (Status==="connected"){
window.open(URL,"_system");
}else{
console.log("The connections has not been completed by both parties, waiting on other party");
}/code

It opens the link but it is always in the inApp browser, not safari.

I've been checking into seeing if there is something in xcode (v5.0.2) that I need to change but have been unable to find anything yet.


Open Links in Safari (iOS)/Native Browser

Posted: Mon Apr 21, 2014 2:07 am
by Illya Stepanov

How you define local storage variable URL?


Open Links in Safari (iOS)/Native Browser

Posted: Mon Apr 21, 2014 2:47 am
by Matt6607699

The URL is loaded from the database to a label in a grid ="user_url_label". When the button is clicked, I have an event that sets local storage variable: "local_connection_URL" bind to component "user_url_label".

The same is then done with "connection_status"

Then I run the JS from the previous post. The correct URL is stored and it opens the correct location when I use window.open(URL,"_system");
It just opens in the in app browser instead of safari.


Open Links in Safari (iOS)/Native Browser

Posted: Mon Apr 21, 2014 3:08 am
by Illya Stepanov

Are you using iframe on that page? If it possible can you give us public link to take a look?