如果 NSAllowsArbitraryLoads 设置为 YES,App Store 会拒绝提交吗?

Does App Store reject submission if NSAllowsArbitraryLoads set to YES?

iOS9 涉及的新 ATS 导致许多与 http 相关的功能停止工作。我必须将所有 http 请求 url 添加到白名单中,或者我可以通过将 NSAllowsArbitraryLoads 设置为 YES.

来简单地禁用 ATS

有谁知道如果 NSAllowsArbitraryLoads 设置为 YES App Store 会拒绝提交吗?

所有使用 NSURLConnection、CFURL 或 NSURLSession API 的连接都在为 iOS 9.0 或更高版本以及 OS X 10.11 或更高版本构建的应用程序中使用 App Transport Security 默认行为。不符合要求的连接将失败。

但是,您可以在应用程序或扩展程序的 Info.plist 文件中指定默认行为的例外情况。使用 属性 列表中的键来处理特定的例外情况或关闭 App Transport Security。 Table 1-1 显示键及其类型,并使用缩进表示结构。

来源link:https://developer.apple.com/library/prerelease/ios/technotes/App-Transport-Security-Technote/index.html

谢谢大家的回答。

好消息是 Apple Accepted 我的应用 NSAllowsArbitraryLoads 设置为 YES

(感谢@Vijayts): Apple 将在 2016 年 12 月结束后拒绝不符合 ATS 的 App。

Source

但是,如果您只需要在网络 (UIWebView/WKWebView/SafariViewController) 中加载 http:// 资源,那么以下内容就足够了。

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoadsInWebContent</key>
    <true/>
</dict>

更新:Apple 将在 2016 年 12 月结束后拒绝不符合 ATS 的应用程序。

Source

但是,如果您只需要在网络 (UIWebView/WKWebView/SafariViewController) 中加载 http:// 资源,那么以下内容就足够了。

注意:此密钥仅在 iOS 10 后可用。

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoadsInWebContent</key>
    <true/>
</dict>

Apple 似乎改变了计划:

Supporting App Transport Security

To give you additional time to prepare, this deadline has been extended and we will provide another update when a new deadline is confirmed. https://developer.apple.com/news/?id=12212016b

我们最近一次从 Apple 得知 NSAllowsArbitraryLoads 是在 2016 年 12 月。 https://developer.apple.com/news/?id=12212016b

A​​pple 仍在接受新的应用程序和更新。我的新应用程序于 2017 年 4 月获得批准,NSAllowsArbitraryLoads 设置为 YES。我最近也提交了更新,没问题没被拒。

我有一个应用程序允许用户指定 URL 在执行期间显示在网络视图中。这个URL可能是一个HTTPURL。出于这个原因,我将 NSAllowsArbitraryLoads 设置为 yes。

我在 2016 年 12 月之后提交了此应用的更新,没有遇到任何问题。

我的 plist 还指定了 NSAllowsArbitraryLoadsInWebContent 并且我指定了为我的应用程序在支持 TLS 的情况下使用的已知 Web 服务激活 TLS 的例外。

我只是附上了评论说明,解释说 NSAllowsArbitraryLoadsInWebContent 是不够的,因为我的应用在 iOS 9 上受支持。

我什至从未收到过关于此应用评论的问题。