1

There is a requirement, where the iphone app will have the placeholder to open some static content on it. The static content will be rendered from 3rd party site. In that static content, there is a link, which needs to be opened in default browser.

Link contains in <a> tag. Something like this :

<a href="http://www.example.com"> open in default browser </a>

The problem is, the link is opening in App not in the default browser.

My question is, where this needs to be handled?

  1. As static content is coming from the third party site, will this be handled from there side.

  2. Is this something needs to be looked into the app dev side?

  3. Or any custom url needs to be configured?

Deduplicator
  • 44,692
  • 7
  • 66
  • 118
PaRsH
  • 1,320
  • 4
  • 28
  • 56

1 Answers1

0
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.example.com"]];

It has been answered in more detail here:
How to launch safari and open URL from iOS app

Community
  • 1
  • 1
ae dev
  • 3
  • 4
  • Thanks DEV for quick response. As per you, this must be handled from the App side, not from the web development side, isn't it? – PaRsH Sep 07 '15 at 12:08
  • Yes, just inside any of your UIViewController in viewDidLoad method for example. In case you're serios about iOS those guys have clear tuts http://www.appcoda.com/ios-programming-course/ – ae dev Sep 07 '15 at 12:13
  • 1
    You know, it's nice you found the duplicate. But that's not an acceptable answer, we have dupe-closure for that. When you have 50 rep you get that option, this time I did it for you. – Deduplicator Sep 07 '15 at 12:53