0

I am using UI webview in xcode in my iphone mobile application..i am loading my website in webview but all link in website like(facebook,twitter,youtube etc..)are open in same webview not in mobile safari..

please suggest me how to do it

thanks in advance

1 Answers1

0

see: UIWebView Launch in Safari

you need to examine the url to see if it belongs to facebook,twitter,youtube etc and if so launch accordingly

-(BOOL) adBox:(UIWebView *)inWeb shouldStartLoadWithRequest:(NSURLRequest *)inRequest            
                                         navigationType:(UIWebViewNavigationType)inType {


   if (![inRequest.URL.host isEqualToString:@"www.mydomain.com"]) { //Test if it's NOT my site
       if ( inType == UIWebViewNavigationTypeLinkClicked ) {
          [[UIApplication sharedApplication] openURL:[inRequest URL]];
           return NO; //Open in Safair
       }
     }

   return YES; //Open in UIWebView

 }
Community
  • 1
  • 1
Zigglzworth
  • 6,645
  • 9
  • 68
  • 107