简体   繁体   中英

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 . also using ip Address to communicate to the server. I added all the App Transport security settings.

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)

But I only have IP to communicate.

Is any way to communicate IP address in http. 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 )

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.

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 ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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