Hello! This is the official page of Wayne Sebastian Pereanu.

Software > Cheat Sheets > Objective-C


Opening hyperlinks in external Safari from within an iOS PhoneGap App Open Classes>AppDelegate.m

Find the method -(BOOL)webView:…
Before:
return [ super webView:theWebView shouldStartLoadWithRequest:request navigationType:navigationType ];

After:
NSURL *url = [request URL];
if ( [[url scheme] isEqualToString:@"http"] ) {
   [[UIApplication sharedApplication] openURL:url];
   return NO;
} else {
   return [ super webView:theWebView shouldStartLoadWithRequest:request navigationType:navigationType ];
}