Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

gwelmarten

macrumors 6502
Original poster
Jan 17, 2011
476
0
England!
Hi
I am writing a web application that requires part of the code to be run in safari. Because of the environment it is going to be deployed in, it will mostly be running in web apps on peoples devices. In this situation I do not have access to the source code to make a change so that if a certain url is called it switches to safari. Is it possible to write my html/javascript hyperlink such that when the link is opened, it switches to safari to open it?
Thanks!
Sam
 

waterskier2007

macrumors 68000
Jun 19, 2007
1,871
228
Novi, MI
Why are you running it in a web view. If you need to run it in safari, why not do so by calling

Code:
[[UIApplication sharedApplication] openURL:URLtoOpen]
 

gwelmarten

macrumors 6502
Original poster
Jan 17, 2011
476
0
England!
Why are you running it in a web view. If you need to run it in safari, why not do so by calling

Code:
[[UIApplication sharedApplication] openURL:URLtoOpen]

I have already said I do not have access to source code (please, let's not discuss these other details - just the problem - I know what I am doing with the situation - it's purely technical help I need) and lots of the time I can not stop it been run in a webview. Please accept these as fixed.

----------



Thanks for replying anyway :)
 
Last edited by a moderator:

ArtOfWarfare

macrumors G3
Nov 26, 2007
9,561
6,059
Two things:

1 - I forgot this was iOS specific so I dug up this which is likely of limited use, as it involves using a shell: http://forums.asp.net/t/1652038.aspx

2 - Since this is iOS specific, then look into if Mobile Safari accepts any specially formatted URLs. If I'm not mistaken, you can format URLs a special way to make Chrome for iOS open them. I can't recall what the official name of the special URLs are, but there's one for Maps and YouTube, and probably other apps that I can't think of right now.
 

waterskier2007

macrumors 68000
Jun 19, 2007
1,871
228
Novi, MI
I have already said I do not have access to source code (please, let's not discuss these other details - just the problem - I know what I am doing with the situation - it's purely technical help I need) and lots of the time I can not stop it been run in a webview. Please accept these as fixed.

----------



Thanks for replying anyway :)

What I am saying is that at some point you have to have the url to open in the webview so at that point you could just open said url the way I mentioned
 

ArtOfWarfare

macrumors G3
Nov 26, 2007
9,561
6,059
What I am saying is that at some point you have to have the url to open in the webview so at that point you could just open said url the way I mentioned

... he clearly stated he has no access to the source code, which means he clearly can't do what you suggested. He didn't say why - there's any number of reasons it could be. Maybe he's trying to make it so all apps that could display his webpage force it to open in Safari because it needs the faster JS engine to display smoothly?
 

waterskier2007

macrumors 68000
Jun 19, 2007
1,871
228
Novi, MI
... he clearly stated he has no access to the source code, which means he clearly can't do what you suggested. He didn't say why - there's any number of reasons it could be. Maybe he's trying to make it so all apps that could display his webpage force it to open in Safari because it needs the faster JS engine to display smoothly?

Gotcha, guess I wasn't understanding but after re-reading I get it.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.