Apple明文规定所有开发者在6月1号以后提交新版本需要支持IPV6-Only的网络,如果ipv6测试不通过,苹果会直接拒审,因为项目太老,所以这次升级送审持续了两个月,估计以后不会再碰到这种问题了,毕竟如果不是公司要求,其实这个已经被淘汰了。
一、APP应用修改
对于app应用来说,如果采取的原生的函数可以直接支持,但是不要直接写连接ip,而要写域名,这样就可以不用修改源码即可
If you’re writing a client-side app using high-level networking APIs such as NSURLSession and the CFNetwork frameworks and you connect by name, you should not need to change anything for your app to work with IPv6 addresses. If you aren’t connecting by name, you probably should be. See Avoid Resolving DNS Names Before Connecting to a Host to learn how. For information on CFNetwork, see CFNetwork Framework Reference.
If you’re writing a server-side app or other low-level networking app, you need to make sure your socket code works correctly with both IPv4 and IPv6 addresses. Refer to RFC4038: Application Aspects of IPv6 Transition.
如果采用的AFNetworking第三方库,就需要升级到新版本,新版本已经支持ipv6,直接全部覆盖AFNetworking库,然后有可能函数方法会变,但是修改起来比较简单,修改完成之后测试即可。
二、cocos2d-x 2.x版本版本修改
在cocos2d-x 3.11之后,就直接支持ipv6了,但是下面的就需要修改整个库,3.x版本其实和2.x版本一样,就是修改网络库,主要就是curl和websocket这两个库。
参考这个官方说明:http://discuss.cocos2d-x.org/t/supporting-ipv6-only-networks/29266/9
这个说明的回复里面的官方的解决方案
Hi all,
The status of this task is:
- it is finished for v3
- v2 is fixed except of windows and wp8, has compiling error on these two platforms because of upgrading libwebsockets. Will support them ASAP.
How to do
You can just update?libwebsockets?and?CURL?like this:
- modify?Cocos2d-x root/external/config.json?to update the dependency version. For v3.x the dependency version is?
v3-deps-94
, and for v2.x it is?v2-deps-6
- execute the?download-deps.py?script in your?Cocos2d-x root.
Edit: i also modify?Console?and?ScriptingCore?to support IPv6-only network in?this PR?, but i think it is not needed for you to do like this because they are just for testing, not be used in game logic.
If you are using v2.x, you also need to apply?this commit?to fix compiling error.
Edit: windows compiling issue of v2 is fixed, you need to download?v2-deps-v7?instead if you work on windows. And you may need to link?ws2_32.lib?in libexternal project. Refer to?this commit?for detail information.
这个也说了V2.x的库的地址:https://github.com/cocos2d/cocos2d-x-3rd-party-libs-bin/releases/tag/v2-deps-7
下载之后,可以查找ios用到的curl库,然后只替换ios的即可,如果用到了websocket,还需要替换websocket库。
是不是很简单,但是如果有各种小错的话还是要百度的
三、检查服务器是否支持ipv6
之前忽略了检查服务端,需要服务端APP服务器域名添加IPv6解析,添加一条4A记录,至于怎么添加让你们运维添加就行了,不是前端开发要干的活,搭建好DNS64环境后,可以通过以下命令查询:
dig?dnspod.cn?aaaa
四、设置本地ipv6网络测试app
ipv6的设置方式可以按照这个文章设置《【指南】本地如何搭建IPv6环境测试你的APP》,设置完成之后,先打开safari网页连接下百度试试,如果能打开百度,说明设置正确可以开始测试app了,如果网页打不开,说明没有正确创建,可以重新创建或者重启下电脑重新创建。
五、提审如果被拒的应对方案
如果本地测试没问题,软件还是因为ipv6网络链接不上被拒了,可以用下面这几个方案测试下,这几个是网友提供的方案,我使用的结果
1、检查本地的网络和机型,看是否因为某种机型的问题,或者你游戏服务器的状况是否能在国外链接的上(几率比较小,并且重新完整替换网络库,依旧被拒绝)
2、录段本地测试的视频,包括手机开启ipv6的视频,可以提交到youtube这类国外视频网站,然后在被拒绝的消息中回复苹果让他们重新测试下,并且说明自己测试视频的地址,他们会参考的。(我录制了,苹果重新审核了,但是依旧说连接不上服务器被拒绝)
3、临时租一台国外服务器,等上线之后再切换到国内服务器(租了一台比较好点的国外临时服务器,大概一百五一个月,重新审核苹果审核通过,看来还是这个方案靠谱)
主要差异就是苹果测试的时候,网络和国内不太一样,所以会出现在自己电脑测试可以,但是国外就不可以的状况,所以可以考虑下第三种方案。
六、一个小广告(2017.5.11)
发表了这个文章之后,收到了两次邮件就是别人推荐这个免费的测试工具的,因为离当初碰到这个问题,已经隔了一年,所以我暂时没有这方面的需求,就没有测试好用不好用,如果有这类需求的,可以测试下https://www.comparitech.com/
七、参考文章
- 【指南】本地如何搭建IPv6环境测试你的APP
- ipv6审核被拒绝的解决方案
- ipv4-only网络环境下访问ipv6站点的三种方式
- AppStore IPv6-only审核被拒原因分析及解决方案
- 本地测试ipv6没有问题,审核被拒,这是怎么回事
- IPV6测试
- IPv6简介测试
版权属于:东哥笔记 - DongGe.org
本文链接:https://dongge.org/blog/374.html
自2017年12月26日起,『转载以及大段采集进行后续编辑』须注明本文标题和链接!否则禁止所有转载和采集行为!
9 条评论
Please accept our gratitude for sharing. I've read your site once before, and I found it to be fascinating. I recommend enrolling in one of top Software Testing training in Noida, which will enable you to become a successful Software expert.谢谢你
You have amazing writing skills and you display them in every article. Keep it going!
Cyber Security Online Course
诶
You have amazing writing skills and you display them in every article. Keep it going!
Cyber Security Online Course 诶
Thank you for sharing with us! I round up the first time at your blog and it was interesting. I suggest one of the best python training courses in Noida that help you to succeed as a python expert.
I have scrutinized your article; it is particularly instructive and strong for me. I appreciate the significant information you offer in your articles. Thankful for posting it. Cyber Security Course in Malaysia
Hello there to everyone, here everybody is sharing such information, so it's fussy to see this webpage, and I used to visit this blog day by day
cyber security Course
Thank you for this post! I think you can share it on your facebook page too. From here https://soclikes.com you can get some likes for this post
Yüzlerce kadın,erkek ve çocuk termal içlik modeli Gipaş Tekstil'de!
Through this post, I realize that your great information in playing with all the pieces was exceptionally useful. I advise this is the primary spot where I discover issues I've been scanning for. You have a smart yet alluring method of composing.
cyber security Course