简体   繁体   English

无法从应用商店访问ios中的任何Web服务

[英]Can't access any web service in ios from app store

I used NSURLConnect in my app to start web service connection. 我在应用程序中使用NSURLConnect来启动Web服务连接。 I knew that apple deprecated this interface since ios 9.0 for more safty, while it also said a way to support http(add some para in xcode config to forbid ATS). 我知道苹果从ios 9.0起就不再使用此接口了,以便更安全,同时它还说了一种支持http(在xcode配置中添加一些段以禁止ATS)的方法。 I exactly did as it said, and it run well when I developed(use usb connect to ipad which run in ios 9). 我完全按照它说的做,并且在我开发时运行良好(使用usb连接到在ios 9中运行的ipad)。

My app was designed for inner net envirenment. 我的应用程序是为内部网络环境设计的。 I uploaded a vedio for detail introduce when I submit it to apple, because they certainly could not connect to my server. 我上传了一个视频,以便在提交给Apple时进行详细介绍,因为它们肯定无法连接到我的服务器。 Nicely they approved my app. 很好,他们批准了我的应用。

Now I'm very glad to say my app is ready for sale. 现在,我很高兴地说我的应用已准备好出售。 But when I setup it from app store and run, strange thing happens, it can not connect to the server! 但是,当我从应用程序商店安装并运行它时,发生了奇怪的事情,它无法连接到服务器! Through log I see the reason is no byte send succeefully by NSURLConnect sendSynchronousRequest. 通过日志,我看到原因是没有字节被NSURLConnect sendSynchronousRequest成功发送。 Why it runs well by devoloping, I am sure the code I submit is the same, and the ipad is run as ios 9. 为什么通过开发可以正常运行,我确定提交的代码是相同的,并且ipad作为ios 9运行。

I guess maybe I do something wrong during uploading. 我想也许我在上传过程中做错了。 There is some info of my develop envirenment: 有关我的开发环境的一些信息:

  1. Xcode 7.2 Xcode 7.2
  2. Deployment Target 8.0 部署目标8.0
  3. Base SDK ios 9.2(Latest) 基本SDK iOS 9.2(最新)
  4. Build Active Architecture Only Debug Yes Release No 仅构建活动体系结构调试是发行版否

    I use xcode Archive to upload. 我使用xcode存档上传。 BTW, I have tested in ipad runs in ios 8.2 it was also not right. 顺便说一句,我已经在ios 8.2中的ipad中测试了它也不合适。

As of 9.0 Apple made ssl a requirement but in the meantime provided a workaround. 从9.0开始,Apple要求ssl,但与此同时提供了一种解决方法。

Make sure your Info.plist file has NSAppTransportSecurity added to it. 确保您的Info.plist文件已添加NSAppTransportSecurity。 This example will allow you to make any connection. 此示例将允许您进行任何连接。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我可以从iOS模拟器中访问App Store吗? - Can I access the App Store from within the iOS Simulator? 可以从Web服务检索数据库查询输出的iOS应用吗? - iOS app that can retrieve database query output from web service? 无法从iOS访问https Web服务 - Unable to access https web service from iOS 无法从 iOS 应用访问 Firebase 存储默认存储桶 - Can't Access Firebase Storage Default Bucket From iOS App ios应用程序如何在安装过程中从Web服务下载图片并将其安装在用户ios设备上? - How can an ios app download pictures from a web service and install them at users ios device during installation? Web应用程序的桌面版本可以访问REST API,iOS版本无法访问 - Desktop version of web app can access REST API, iOS version can't Xcode 找不到任何 iOS App Store 配置文件 - Xcode couldn't find any iOS App Store Provisioning Profiles 如何安排对服务器的每小时请求并将数据存储在我自己的服务器上以从iOS应用访问? - How can I schedule hourly request to a server and store data on my own server to access from iOS app? 为什么这个iOS应用程序无法访问网络? - Why can't this iOS app access the network? 无法将iOS应用上传到应用商店,也无法在应用商店中选择我的.ipa文件 - Can't upload an iOS app into app store and Can't choose my .ipa file in app store
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM