0

I just created an application made with WebView me but all the links open in the same application.

as how I can open. pdf in safari browser?

example:

to open link in facebook we use: fb://profile/257099684360698

to open link in twitter we use: twitter://user?id= 90748900

There is something to open on safari?

e.g: "safari://"

excuse my bad English.

ivanooh
  • 21
  • 3
  • you won't be able to see the pdf as it is in the sandbox of your app and safari is a different app – Mutawe Dec 02 '13 at 09:05

1 Answers1

0

Add this to the UIWebView delegate:

-(BOOL) webView:(UIWebView *)inWeb shouldStartLoadWithRequest:(NSURLRequest *)inRequest navigationType:(UIWebViewNavigationType)inType {
    if ( inType == UIWebViewNavigationTypeLinkClicked ) {
        [[UIApplication sharedApplication] openURL:[inRequest URL]];
        return NO;
    }

    return YES;
}

Look at this question on SO.

Community
  • 1
  • 1
  • example: to open link in facebook we use: fb://profile/257099684360698 to open link in twitter we use: twitter://user?id= 90748900 There is something to open on safari? e.g: "safari://" excuse my bad English. – ivanooh Dec 02 '13 at 09:13
  • you can pass through file:// requests which would be relative links. –  Dec 02 '13 at 09:15
  • so, in the html i can use: pdf. only that? – ivanooh Dec 02 '13 at 09:31