<bdo id='YxHb8'></bdo><ul id='YxHb8'></ul>

      <legend id='YxHb8'><style id='YxHb8'><dir id='YxHb8'><q id='YxHb8'></q></dir></style></legend>
      <tfoot id='YxHb8'></tfoot>

        <small id='YxHb8'></small><noframes id='YxHb8'>

      1. <i id='YxHb8'><tr id='YxHb8'><dt id='YxHb8'><q id='YxHb8'><span id='YxHb8'><b id='YxHb8'><form id='YxHb8'><ins id='YxHb8'></ins><ul id='YxHb8'></ul><sub id='YxHb8'></sub></form><legend id='YxHb8'></legend><bdo id='YxHb8'><pre id='YxHb8'><center id='YxHb8'></center></pre></bdo></b><th id='YxHb8'></th></span></q></dt></tr></i><div id='YxHb8'><tfoot id='YxHb8'></tfoot><dl id='YxHb8'><fieldset id='YxHb8'></fieldset></dl></div>

        在 iOS 9 中为应用内浏览器禁用 ATS?

        Disabling ATS for an in-app browser in iOS 9?(在 iOS 9 中为应用内浏览器禁用 ATS?)

          <tbody id='LRcNr'></tbody>
        • <small id='LRcNr'></small><noframes id='LRcNr'>

                <i id='LRcNr'><tr id='LRcNr'><dt id='LRcNr'><q id='LRcNr'><span id='LRcNr'><b id='LRcNr'><form id='LRcNr'><ins id='LRcNr'></ins><ul id='LRcNr'></ul><sub id='LRcNr'></sub></form><legend id='LRcNr'></legend><bdo id='LRcNr'><pre id='LRcNr'><center id='LRcNr'></center></pre></bdo></b><th id='LRcNr'></th></span></q></dt></tr></i><div id='LRcNr'><tfoot id='LRcNr'></tfoot><dl id='LRcNr'><fieldset id='LRcNr'></fieldset></dl></div>
                <tfoot id='LRcNr'></tfoot>
              • <legend id='LRcNr'><style id='LRcNr'><dir id='LRcNr'><q id='LRcNr'></q></dir></style></legend>

                  <bdo id='LRcNr'></bdo><ul id='LRcNr'></ul>
                • 本文介绍了在 iOS 9 中为应用内浏览器禁用 ATS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  iOS 9 引入 应用传输安全 (ATS) 鼓励使用安全连接.

                  iOS 9 introduces App Transport Security (ATS) to encourage the use of secure connections.

                  这很好,但是如果我的应用程序有一个内置的网络浏览器,用户应该能够使用它来连接到任何网站?例如,Facebook 应用程序允许故事包含指向外部网站的链接.当用户点击此类链接时,它不会启动 Safari,而是启动应用内浏览器.

                  This is great, but what if my app has a built in web browser that the user should be able to use to connect to any website? For example, the Facebook app allows stories to contain links to external websites. When the user taps such a link, rather than launching Safari, it launches an in-app browser.

                  如果没有启用全局 NSAllowArbitraryLoads 标志

                  How can I get this same behavior without enabling the global NSAllowArbitraryLoads flag?

                  我想要强制使用 https 的所有好处,但想在我的内部浏览器中禁用此检查.在理想情况下,Apple 将允许我在 UIWebView 上指定一个属性,以允许它加载不安全的 URL,而不是全部或全部.我无法将每个域都列入白名单,因为我不知道我的用户将加载哪些 URL.我正在寻找与 iOS 8 兼容的解决方案.

                  I want all the benefits of enforcing https usage, but want to disable this check in my internal browser. In an ideal world, Apple would allow me to specify a property on my UIWebView to allow it to load insecure URLs, rather than it being all or nothing. There is no way I can whitelist every single domain, since I have no idea which URLs my users will load. I'm looking for a solution that is compatible with iOS 8.

                  推荐答案

                  比起启用 NSAllowsArbitraryLoads,更安全的解决方案是 有条件地使用 SFSafariViewController,它允许任意加载.

                  Rather than enabling NSAllowsArbitraryLoads, a more secure solution is to conditionally use SFSafariViewController, which allows arbitrary loads.

                  如果该类存在,则显示它,否则,显示您自己的 UIViewController(其中包含一个 UIWebView).

                  If the class exists, then present it, otherwise, present your own UIViewController (which contains a UIWebView).

                  UIViewController *webBrowser;
                  if ([SFSafariViewController class] != nil) {
                      webBrowser = [[SFSafariViewController alloc] initWithURL:url];
                  } else {
                      webBrowser = [[ABCWebBrowserController alloc] initWithURL:url];
                  }
                  
                  [self presentViewController:webBrowser animated:YES completion:nil];
                  

                  这篇关于在 iOS 9 中为应用内浏览器禁用 ATS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  iOS UIWebView app opens link in Safari(iOS UIWebView 应用在 Safari 中打开链接)
                  Close UIWebView using javascript:window.close();(使用 javascript:window.close() 关闭 UIWebView;)
                  NSCachedURLResponse returns object, but UIWebView does not interprets content(NSCachedURLResponse 返回对象,但 UIWebView 不解释内容)
                  Trouble hiding iAd banner and displaying UIWebView in its place(无法隐藏 iAd 横幅并在其位置显示 UIWebView)
                  Knowing when AJAX has loaded in UIWebView(知道何时在 UIWebView 中加载了 AJAX)
                  Load image/logo in existing HTML input field - UIWebView(在现有的 HTML 输入字段中加载图像/徽标 - UIWebView)

                  <small id='2H9Xw'></small><noframes id='2H9Xw'>

                    • <legend id='2H9Xw'><style id='2H9Xw'><dir id='2H9Xw'><q id='2H9Xw'></q></dir></style></legend>
                        <tfoot id='2H9Xw'></tfoot>
                          <tbody id='2H9Xw'></tbody>
                        <i id='2H9Xw'><tr id='2H9Xw'><dt id='2H9Xw'><q id='2H9Xw'><span id='2H9Xw'><b id='2H9Xw'><form id='2H9Xw'><ins id='2H9Xw'></ins><ul id='2H9Xw'></ul><sub id='2H9Xw'></sub></form><legend id='2H9Xw'></legend><bdo id='2H9Xw'><pre id='2H9Xw'><center id='2H9Xw'></center></pre></bdo></b><th id='2H9Xw'></th></span></q></dt></tr></i><div id='2H9Xw'><tfoot id='2H9Xw'></tfoot><dl id='2H9Xw'><fieldset id='2H9Xw'></fieldset></dl></div>

                          <bdo id='2H9Xw'></bdo><ul id='2H9Xw'></ul>