[英]iOS (Xcode) open links from webview in external Safari with apple-mobile-web-app-capable
Well, I have an app that is just a web view that loads a website. 好吧,我有一个应用程序,只是一个加载网站的网络视图。 I would like that, when I click on a link, that link opens in a new Safari window BUT recognizing the 'apple-mobile-web-app-capable'
meta tag I have on that new site, just as if I would have added that site to the home screen. 我想,当我单击一个链接时,该链接会在新的Safari窗口中打开,但会识别出我在该新站点上具有的'apple-mobile-web-app-capable'
元标记,就好像我将添加该网站到主屏幕。
Is that possible? 那可能吗?
Cheers! 干杯!
You should check the delegate methods of the WebView - 您应该检查WebView的委托方法-
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request
navigationType:(UIWebViewNavigationType)navigationType; navigationType:(UIWebViewNavigationType)navigationType;
Where you can check the URL pattern and return NO and open that URL in safari programatically. 您可以在其中检查网址格式并返回“否”,然后以编程方式在野生动物园中打开该网址。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.