gpt4 book ai didi

ios - 设备 9.0 上的 NSURLSession/NSURLConnection HTTP 加载失败

转载 作者:行者123 更新时间:2023-11-29 11:59:36 24 4
gpt4 key购买 nike

我正在使用 cordova/ionic 开发应用程序,但自从 iOS 9 更新后我无法部署到设备。我的应用程序可以在模拟器上运行,但是无论我尝试什么,当我部署到设备时,我都会遇到同样的错误。我知道有很多关于这个问题的帖子,但没有一个能够解决我的问题。

有没有人在使用相同平台(ionic/cordova)时遇到同样的问题。

这是我的 .plist 的样子:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIcons</key>
<dict/>
<key>CFBundleIcons~ipad</key>
<dict/>
<key>CFBundleIdentifier</key>
<string>io.cordova.myappff160c</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.6</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0.6</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSMainNibFile</key>
<string/>
<key>NSMainNibFile~ipad</key>
<string/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
<key>UIRequiresFullScreen</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSExceptionDomains</key>
<dict>
<key>m.facebook.com</key>
<dict/>
<key>graph.facebook.com</key>
<dict/>
<key>api.facebook.com</key>
<dict/>
<key>fbcdn.net</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
<key>akamaihd.net</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
</dict>
</dict>
<key>UIInterfaceOrientation</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>FacebookAppID</key>
<string>xxxxxxxxxxxxxx</string>
<key>FacebookDisplayName</key>
<string>Birdy.life</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>fb1074874362552202</string>
</array>
</dict>
</array>
<key>NSLocationWhenInUseUsageDescription</key>
<string/>
<key>UIBackgroundModes</key>
<array>
<string>remote-notification</string>
</array>
</dict>
</plist>

这是我在部署到设备时得到的输出:

2016-05-30 17:31:53.465 Birdy[1102:584334] Apache Cordova native platform version 4.1.1 is starting.

2016-05-30 17:31:53.468 Birdy[1102:584334] Multi-tasking -> Device: YES, App: YES

2016-05-30 17:31:53.576 Birdy[1102:584334] Using UIWebView

2016-05-30 17:31:53.581 Birdy[1102:584334] [CDVTimer][handleopenurl] 0.264049ms

2016-05-30 17:31:53.588 Birdy[1102:584334] Unlimited access to network resources

2016-05-30 17:31:53.590 Birdy[1102:584334] [CDVTimer][intentandnavigationfilter] 7.857978ms

2016-05-30 17:31:53.591 Birdy[1102:584334] [CDVTimer][gesturehandler] 0.279963ms

2016-05-30 17:31:53.592 Birdy[1102:584334] Starting Facebook Connect plugin

2016-05-30 17:31:53.593 Birdy[1102:584334] [CDVTimer][facebookconnectplugin] 1.308978ms

2016-05-30 17:31:53.626 Birdy[1102:584334] [CDVTimer][splashscreen] 32.754004ms

2016-05-30 17:31:53.663 Birdy[1102:584334] [CDVTimer][localstorage] 35.548985ms

2016-05-30 17:31:53.664 Birdy[1102:584334] [CDVTimer][TotalPluginStartup] 84.178030ms

2016-05-30 17:31:53.973 Birdy[1102:584334] Resetting plugins due to page load.

2016-05-30 17:31:55.337 Birdy[1102:584398] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813)

2016-05-30 17:31:55.340 Birdy[1102:584398] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813)

2016-05-30 17:31:55.448 Birdy[1102:584398] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813)

2016-05-30 17:31:55.711 Birdy[1102:584334] Finished load of: file:///var/containers/Bundle/Application/F5E4D8B5-7A45-4DA7-B7CE-CFC12DB7A5FF/Birdy.app/www/index.html#/public/home

2016-05-30 17:31:56.066 Birdy[1102:584392] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813)

2016-05-30 17:31:56.126 Birdy[1102:584392] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813)

2016-05-30 17:31:58.309 Birdy[1102:584398] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813)

我唯一看到的是启动画面,仅此而已。我是否遗漏了某些东西或忽略了它?

最佳答案

我建议您对 NSAppTransportSecurity Info.plist 设置进行尝试。您得到的错误表明您的服务器没有使用最新和最好的 TLS,或者以某种方式以某种方式错误配置。我相信,当您开始指定比我下面所列内容更多的内容时,您实际上是在限制事物而不是让它们完全开放(我假设这就是您想要的)。

<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>

关于ios - 设备 9.0 上的 NSURLSession/NSURLConnection HTTP 加载失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37529476/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com