由于 ipv6 网络连接问题,应用被拒绝
App rejected because of ipv6 network connectivity issues
拒绝我的应用程序的原因是 ipv6 网络连接问题。
首先,我使用 AWS 作为我的后端服务器。我使用我的域名连接我的服务器,例如 http://ec2-XX-XXX-XXX-XXX.compute-1.amazonaws.com:80/parse 其中 X 是一个数字
其次,我尝试重现该问题
a) 转到我的 iPhone 设置 -> 开发人员 -> 状态(Newwork link 调节器) -> 创建一个与 LTE 完全相同但协议为 IPv6 的配置文件
b) 按照 Apple 的建议做同样的事情。使用 thunderbolt 以太网连接我的 MacBook 并与我的 iPhone 共享 wifi。
我的应用程序适用于这两种情况。
第三,看一下AWS上关于支持IPv6的内容。这里是link。 http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/ResourceRecordTypes.html#AAAAFormat 看来应该没什么变化了。我不太确定,因为我对服务器不熟悉。
有什么建议吗?谢谢
更新
如果您使用旧苹果的 Rechability class 并且如果您使用旧 AFNetworking 的 AFNetworkReachabilityManager class
响应 - 我没有为 Reachability 或 AFNetworking 实现任何代码。我是否应该担心那些 classes 在其他来源的框架(如 Parse)中?
如果您使用的是硬编码 IP 地址
响应:我的域名是 http://ec2-XX-XXX-XXX-XXX.compute-1.amazonaws.com:80/parse,其中 X 是一个数字。所以,我觉得这样应该没问题。
有几点经常导致这个问题。
- 如果您使用的是旧苹果的
Rechability
class 则将其替换为最新的,因为旧 Rechability class
与仅 ipv6 网络不兼容。
- 与旧的
AfNetworking
库相同,如果您使用的是旧的 AFNetworking's AFNetworkReachabilityManager class
然后将此 class 替换为最新的 AFNetworkReachabilityManager
class 或将整个库替换为最新的
- 如果您将
hard coded IP addresses
用作 api
,则将其替换为域名。例如,您不应该使用 api,例如:http://192.168.1.11:4444/login
。你的 api 应该是这样的:http://api.example.com/login
如 Apple 文档所述,
Make sure you aren’t passing IPv4 address literals in dot notation to
APIs such as getaddrinfo and SCNetworkReachabilityCreateWithName.
Instead, use high-level network frameworks and address-agnostic
versions of APIs, such as getaddrinfo and getnameinfo, and pass them
hostnames or fully qualified domain names (FQDNs). See getaddrinfo(3)
Mac OS X Developer Tools Manual Page and getnameinfo(3) Mac OS X
Developer Tools Manual Page.
Note: In iOS 9 and OS X 10.11 and later, NSURLSession and CFNetwork
automatically synthesize IPv6 addresses from IPv4 literals locally on
devices operating on DNS64/NAT64 networks. However, you should still
work to rid your code of IP address literals
- 并且您的 api 托管服务器应该与
ipv6
兼容(这不是主要问题,因为几乎服务器都与 ipv6 兼容)
详情可参考Apple documentation
您将了解如何在您的 mac 上创建仅 ipv6 网络以通过上述 apple 文档进行测试!
我的应用已获批准。
我唯一改变的是
- 将签名设置为 "automatically managing signing" 因为当我将构建配置更改为 "Release" 时我的应用程序无法 运行 (我不确定这是否与 IPv6 相关。我认为它有点奇怪)
其他使用Google地图api、AWS中解析托管和Facebook登录的人参考:
- 我认为他们的框架可以很好地通过 IPv6 要求。
我还在质疑为什么 Apple 在我上次提交时说我的应用程序未能通过 IPv6 要求。
拒绝我的应用程序的原因是 ipv6 网络连接问题。
首先,我使用 AWS 作为我的后端服务器。我使用我的域名连接我的服务器,例如 http://ec2-XX-XXX-XXX-XXX.compute-1.amazonaws.com:80/parse 其中 X 是一个数字
其次,我尝试重现该问题 a) 转到我的 iPhone 设置 -> 开发人员 -> 状态(Newwork link 调节器) -> 创建一个与 LTE 完全相同但协议为 IPv6 的配置文件 b) 按照 Apple 的建议做同样的事情。使用 thunderbolt 以太网连接我的 MacBook 并与我的 iPhone 共享 wifi。 我的应用程序适用于这两种情况。
第三,看一下AWS上关于支持IPv6的内容。这里是link。 http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/ResourceRecordTypes.html#AAAAFormat 看来应该没什么变化了。我不太确定,因为我对服务器不熟悉。
有什么建议吗?谢谢
更新
如果您使用旧苹果的 Rechability class 并且如果您使用旧 AFNetworking 的 AFNetworkReachabilityManager class
响应 - 我没有为 Reachability 或 AFNetworking 实现任何代码。我是否应该担心那些 classes 在其他来源的框架(如 Parse)中?
如果您使用的是硬编码 IP 地址
响应:我的域名是 http://ec2-XX-XXX-XXX-XXX.compute-1.amazonaws.com:80/parse,其中 X 是一个数字。所以,我觉得这样应该没问题。
有几点经常导致这个问题。
- 如果您使用的是旧苹果的
Rechability
class 则将其替换为最新的,因为旧Rechability class
与仅 ipv6 网络不兼容。 - 与旧的
AfNetworking
库相同,如果您使用的是旧的AFNetworking's AFNetworkReachabilityManager class
然后将此 class 替换为最新的AFNetworkReachabilityManager
class 或将整个库替换为最新的 - 如果您将
hard coded IP addresses
用作api
,则将其替换为域名。例如,您不应该使用 api,例如:http://192.168.1.11:4444/login
。你的 api 应该是这样的:http://api.example.com/login
如 Apple 文档所述,
Make sure you aren’t passing IPv4 address literals in dot notation to APIs such as getaddrinfo and SCNetworkReachabilityCreateWithName. Instead, use high-level network frameworks and address-agnostic versions of APIs, such as getaddrinfo and getnameinfo, and pass them hostnames or fully qualified domain names (FQDNs). See getaddrinfo(3) Mac OS X Developer Tools Manual Page and getnameinfo(3) Mac OS X Developer Tools Manual Page.
Note: In iOS 9 and OS X 10.11 and later, NSURLSession and CFNetwork automatically synthesize IPv6 addresses from IPv4 literals locally on devices operating on DNS64/NAT64 networks. However, you should still work to rid your code of IP address literals
- 并且您的 api 托管服务器应该与
ipv6
兼容(这不是主要问题,因为几乎服务器都与 ipv6 兼容)
详情可参考Apple documentation
您将了解如何在您的 mac 上创建仅 ipv6 网络以通过上述 apple 文档进行测试!
我的应用已获批准。
我唯一改变的是
- 将签名设置为 "automatically managing signing" 因为当我将构建配置更改为 "Release" 时我的应用程序无法 运行 (我不确定这是否与 IPv6 相关。我认为它有点奇怪)
其他使用Google地图api、AWS中解析托管和Facebook登录的人参考:
- 我认为他们的框架可以很好地通过 IPv6 要求。
我还在质疑为什么 Apple 在我上次提交时说我的应用程序未能通过 IPv6 要求。