伙计们,我创建了一个基于 Web View 的 iOS 应用程序。在启动之前,我必须测试它,但我无法在测试应用程序中加载本地主机
这个方法我试过了
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>192.168.0.189</key>
<string></string>
<key>ExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>localhost:port</key>
<string></string>
</dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
还有其他方法吗?
最佳答案
试试这个!
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSExceptionDomains</key>
<dict>
<key>192.168.0.189</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSExceptionRequiresForwardSecrecy</key>
<true/>
<key>NSExceptionMinimumTLSVersion</key>
<string>TLSv1.2</string>
<key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
<false/>
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
<true/>
<key>NSThirdPartyExceptionMinimumTLSVersion</key>
<string>TLSv1.2</string>
<key>NSRequiresCertificateTransparency</key>
<false/>
</dict>
</dict>
</dict>
关于swift - 如何快速加载本地主机,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58968232/