简体   繁体   English

Swift IPv6支持

[英]Swift IPv6 support

I'm trying to submit my iOS app in Apple. 我正在尝试在Apple中提交我的iOS应用。 But they have rejected my app because of problems with IPv6: they tried to connect to our server from IPv6 network, and it wasn't successfull. 但是由于IPv6的问题,他们拒绝了我的应用程序:他们试图通过IPv6网络连接到我们的服务器,但没有成功。
We changed our server side: now our server is ready to use IPv6 (I tested it on ipv6test.com, and everything was good). 我们更改了服务器端:现在我们的服务器已准备好使用IPv6(我在ipv6test.com上对其进行了测试,一切都很好)。
In my app I'm using URLSession.shared.dataTask to create request. 在我的应用程序中,我使用URLSession.shared.dataTask创建请求。 And Apple got problem in such line of code: 苹果在这样的代码行中遇到了问题:

var urlRequest: URLRequest = URLRequest(url: myServerUrl);
urlRequest.httpMethod = "POST";
..... //preparing POST data, setting timeout, etc.
urlRequest.httpShouldHandleCookies - true;
let task = URLSession.shared.dataTask(with: urlRequest, completionHandler: {(data: Data?, response: URLResponse?, error: Error?) in
do {
    guard let resp = response as? HTTPURLResponse else { throw NetworkError.connectionError;} //here they got a problem
....
}
catch {...}

I don't understand, why they cannot connect to our server. 我不明白,为什么他们无法连接到我们的服务器。 From our network (IPv4) everything is good. 从我们的网络(IPv4)来看,一切都很好。
And the main strange thing: I sent this app yesterday at 10:05. 最主要的奇怪之处是:我昨天在10:05发送了此应用。 At 10:30 we've seen one request from the Apple's network, and it was successfull (200 status). 在10:30,我们已经看到来自苹果网络的一个请求,并且请求成功(200个状态)。 It looks very strange, because they wrote, that they cannot even authorize in this app... 看起来很奇怪,因为他们写道,他们甚至不能在此应用中授权...
Please, can somebody help with this situation? 请,有人可以帮助这种情况吗? I don't understand, where is a problem, and what should I do. 我不明白,哪里出了问题,我该怎么办。

You should test issues like this by setting up a DNS64/NAT64 network using a Mac. 您应该通过使用Mac设置DNS64 / NAT64网络来测试类似的问题。 link 链接

Chances are that's what their QA are doing. 这就是他们的质量检查人员正在做的事情。

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

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