如果链接被小 url 或类似的东西缩短,我怎样才能让这个功能工作?它似乎首先通过微型 url 服务器,从而导致无法读取与谷歌相关的关键字。
-(BOOL) webView:(UIWebView *)inWeb shouldStartLoadWithRequest:(NSURLRequest *)inRequest{ NSRange nameRange = [[inRequest.URL absoluteString] rangeOfString:@"google" options:NSCaseInsensitiveSearch];
if(nameRange.location == NSNotFound)
{
[[UIApplication sharedApplication] openURL:[inRequest URL]];
return NO;
}
return YES;
}