简体   繁体   English

测试飞行版本显示无法连接到服务器

[英]Test flight build showing Could not connect to the server

Test flight downloaded app could not connect to the server. 测试飞行下载的应用程序无法连接到服务器。 This work in locally. 这项工作在本地进行。 I am using http . 我正在使用http also using ip Address to communicate to the server. 还使用ip地址与服务器通信。 I added all the App Transport security settings. 我添加了所有App Transport安全设置。

But apple document says: A domain name key for an exception dictionary: 但是苹果文件说:异常字典的域名密钥:

  • Must be lowercased to work correctly 必须小写才能正常工作
  • Must not include a port number 不得包含端口号
  • Must not be a numerical IP address (but rather a string) 不能是数字IP地址(而是字符串)

But I only have IP to communicate. 但是我只有IP可以通信。

Is any way to communicate IP address in http. 是否可以通过任何方式在http中通信IP地址。 It's work one month ago. 一个月前开始工作。

If you are simply trying to access a server via the IP address you can use the zip.io service which will translate an IP to a domain (See: https://stackoverflow.com/a/33811464/3708242 ) 如果您只是尝试通过IP地址访问服务器,则可以使用zip.io服务,该服务会将IP转换为域(请参阅: https ://stackoverflow.com/a/33811464/3708242)

A DNS call to (for example) 10.0.1.8.xip.io will resolve to 10.0.1.8, allowing use of the domain instead of the IP address for the NSExceptionDomains key. 对(例如)10.0.1.8.xip.io的DNS调用将解析为10.0.1.8,从而允许使用域而不是NSExceptionDomains密钥的IP地址。

If, however, your app is using the IP address to communicate with a device on the local network, you can use the NSAllowsLocalNetworking exception in your ATS settings to allow the HTTP connection locally ( documentation ). 但是,如果您的应用程序正在使用IP地址与本地网络上的设备通信,则可以在ATS设置中使用NSAllowsLocalNetworking异常来允许本地HTTP连接( 文档 )。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM