【发布时间】:2016-12-22 07:23:56
【问题描述】:
我的申请因 Ipv6 网络不兼容而被拒绝了两次。
这个问题已经被问过好几次了。大多数解决方案建议避免使用第三方 api 进行 http 请求,并且不要对 ipaddress 进行硬编码。我也没做过。
但是我的服务器必须与 ipv6 兼容还是我的 http 请求有问题。
所以我在这个网站http://ipv6-test.com/validate.php 上测试了我的服务器https://services.fingrowthbank.com/ 以进行Ipv6 就绪测试。它显示为不兼容。这可能是拒绝的原因吗?
http 请求代码
let nsUrlObject: NSURL = NSURL(string: urlAndMethod)!
let nsMutableUrlRequestObj: NSMutableURLRequest = NSMutableURLRequest(URL: nsUrlObject, cachePolicy: NSURLRequestCachePolicy.ReloadIgnoringLocalCacheData, timeoutInterval: nstime_out_intervalObj)
nsMutableUrlRequestObj.HTTPMethod = “POST"
let bodyData = httpBodyStr
nsMutableUrlRequestObj.HTTPBody = bodyData.dataUsingEncoding(NSUTF8StringEncoding)
nsMutableUrlRequestObj.setValue(httpHeaderStr, forHTTPHeaderField: "Authorization")
NSURLConnection.sendAsynchronousRequest(nsMutableUrlRequestObj, queue: NSOperationQueue.mainQueue())
{
(response, data, error) in
if response == nil
{
print(error)
alert.view.removeFromSuperview()
Imps_http_client.showAlertView("Could not connect to the server")
}else{
}
}
【问题讨论】:
-
YES,应用不能在IPv6连接中使用,url是问题检查this
-
之前它允许 ipv4,但现在它必须支持你所有的 webservicesin ipv6 这才是真正的原因,上次我上传一个应用程序时,我收到了一个警告,所以最好将你的所有 webservices 切换到 ipv6 合规性
-
你在追逐野鹅。与其担心您的服务器支持 IPv6,不如担心 Apple 告诉您的应用程序中的错误......但您没有告诉我们。
标签: ios iphone swift networking ipv6