Google과 같은 앵커 태그를 사용하여 외부 링크에 연결하려고합니다.iOS PhoneGap에서 외부 링크 열기
- (BOOL)webView:(UIWebView *)theWebView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
NSURL *url = [request URL];
// Intercept the external http requests and forward to Safari.app
// Otherwise forward to the PhoneGap WebView
if ([[url scheme] isEqualToString:@"http"] || [[url scheme] isEqualToString:@"https"]) {
[[UIApplication sharedApplication] openURL:url];
return NO;
}
else {
return [ super webView:theWebView shouldStartLoadWithRequest:request navigationType:navigationType ];
}
}
하지만 난 여전히 구글 ... 오전에 링크 할 수 없습니다 오전 :
그렇게하기 위해, 나는 (: https://gist.github.com/2012253 코드는 여기에서이다) appDelegate.m이 코드를 추가 뭔가 잘못하고 있는거야? 도움이 필요해.
'ExtrernalHosts' 속성을 올바르게 설정 했습니까 ?? 귀하의 응용 프로그램에서 귀하의 URL 열기 ?? – dhaval
URL이 앱에서 열리지 않고 있습니다 ... 어떻게 외부 호스트를 설정 하시겠습니까? – lakesh
을 Cordova.plist 파일에 넣으세요. 자세한 내용은 http://docs.phonegap.com/en/1.9.0/guide_whitelist_index.md.html#Domain%20Whitelist%20Guide – dhaval