iPhone Safari link to maps.google.com without launching the default Map App
I have a iPhone web app tha开发者_Go百科t has html links to http://maps.google.com. iPhone by default will launch the default Map app when user tapped the links.
I wonder if there is a way to tell iPhone open the https://maps.google.com website instead of fire up the default Map app?
NOTE: My app is a HTML5 web app hosted on a server and not a native app
-(BOOL)webView:(UIWebView *)mainWebView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {
if (navigationType == UIWebViewNavigationTypeLinkClicked) {
//Allows for twitter links
[self.mainWebView loadRequest:request];
return NO;
}
return YES;
}
Try this code it will open the links in the same webview
oh its not a native App not a problem. there is a feature in phonegap which can be used nicely to redirect the links to a small child browser. the plugin is called ChildBrowser
https://github.com/phonegap/phonegap-plugins/tree/master/iPhone/ChildBrowser
this is a very nice tool which can be used to redirect all links to a mini-browser rather than any application.
Check it out works smooth
精彩评论