简体   繁体   English

iOS(Xcode)在具有Apple-Mobile-Web-App功能的外部Safari中打开来自Webview的链接

[英]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.

相关问题 苹果移动网络应用程序功能无法在野生动物园中打开 - apple-mobile-web-app-capable doesn't open in safari 注销后,“具有apple-mobile-web-app功能的”网站切换到Mobile Safari - “apple-mobile-web-app-capable” site switches to Mobile Safari after logout “alert()”和“confirm()”不适用于“apple-mobile-web-app-capable” - "alert()" and "confirm()" not working with "apple-mobile-web-app-capable" 苹果移动网络应用程序功能可中断flowplayer - apple-mobile-web-app-capable breaks flowplayer (iOS 11.2.5)具有Apple Mobile Web应用功能的中断 <input type=“file”> 解决方法? - (iOS 11.2.5) apple-mobile-web-app-capable breaks <input type=“file”> workaround? 升级到iOS 11.3之后,每个apple-mobile-web-app都无法显示全屏幕 - After upgrade to iOS 11.3 web app does not show full screen per apple-mobile-web-app-capable 为什么包含“ apple-mobile-web-app-capable”标签会破坏我的Web应用程序在iOS上的脱机功能? - Why does including the “apple-mobile-web-app-capable” tag break my web-app's offline capability on iOS? 减速期间未触发支持apple-mobile-web-app的滚动事件 - scroll event not fired for apple-mobile-web-app-capable during deceleration 如何使“支持 apple-mobile-web-app-capable”的 session 不丢失? - How do I make "apple-mobile-web-app-capable" not lose its session? 如果添加到主屏幕,则JavaScript无法与支持apple-mobile-web-app的应用一起使用 - JavaScript doesn't work with apple-mobile-web-app-capable if add to Home Screen
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM