2014-02-19 1 views
0

나는 'https://www.google.co.in/#q=adam+scott'과 같은 Google 검색 링크를 하이브리드 ios 앱에 열고 싶습니다. var ref = window.open (url, '_blank', 'location = yes');을 사용하려고했습니다. 하지만 그것은 페이지를로드하지 않습니다. _blank를 _system으로 변경하면 페이지가로드되지만 이전 페이지로 이동하기 위해 완료 버튼이 표시되지 않습니다.외부 Google 검색 링크가 브라우저에서 열려 있습니다.

일부 신체가 해본 적이 있다면 알려주십시오.

navigator.app.loadUrl ('https://www.google.co.in/#q=adam+scott', {openExternal : TRUE})

답변

0

나는 이것이 당신이 찾고있는 무엇을 생각;

0

당신의 MainViewController.m 클래스를 열고 전에 코드 줄을 추가 @end

- (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]; 
    } 
}