0

I am working with a custom iOS iPad application.

Every application in iOS can be treated as a web server (so to speak).

All over the net, I see that you can "call" Twitter from another app by using a hyperlink including "twitter://". What about other applications? Where is a repository from which to learn this information?

I want to use Safari and Adobe. Do I use safari://, or acrobat://?

Note: If you reply to this question by using any Code other than HTML or plain hyperlinks, you are completely wasting your time, my time, and anyone's time who will read your answer at a later date. Many people have asked this question only to get a whole bunch of great answers from smart people...only that the answers do not AT ALL match the question.

MMiroslav
  • 1,672
  • 20
  • 32
  • There is here a similar case, I hope it helps. http://stackoverflow.com/a/12416512/1554821 – doruvil Jun 24 '15 at 14:48
  • 2
    What you are talking about is custom url scheme. There are plenty of resources on web you can google – dopcn Jun 24 '15 at 14:59
  • Re your comment on plain hyperlinks: Sounds like you don't understand how URL Schemes and how to open them work on iOS. – JAL Jun 24 '15 at 15:54

1 Answers1

0

To open a web page in Safari, just use the openURL: function:

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

With Adobe, things are a little more complicated. I couldn't find a public URL scheme, so I downloaded the Adobe Reader app and looked at its Info.plist file. I found its URL scheme to be com.adobe.Adobe-Reader.

// I'm using a local file here, but it should also work with any remote PDF files
NSString *path = [[NSBundle mainBundle] pathForResource:@"SomeFile" ofType:@"pdf"];

NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"com.adobe.Adobe-Reader://%@", path]];

// Check to see if the user has Adobe Reader installed
if ([[UIApplication sharedApplication] canOpenURL:url]) {
    // Reader is installed, open the PDF
    [[UIApplication sharedApplication] openURL:url];
}

So your "plain hyperlinks" are http://www.google.com and com.adobe.Adobe-Reader://.

JAL
  • 41,701
  • 23
  • 172
  • 300