objective-c - iOS设备怎么知道当前网络是IPV4的还是IPV6的
为情所困
为情所困 2017-05-02 09:29:30
0
2
1279

如题,目前我的设备访问的服务器是通过IP加端口来的,
这次苹果审核苹果要求支持IPV6的网络,
在设备里该怎么判断呢,是需要服务器做设置吗?

为情所困
为情所困

reply all(2)
为情所困

Apple is saying that it must support IPv6-only networks, that is, your app can be used normally even if there is only an IPv6 network.
If the IP address you resolve is in IPv4 format `x.x.x.x`, it will not be accessible under an IPv6-only network.

Share the network on a Mac computer with a network cable, select "NAT64", and then connect to your shared network on the iPhone to establish an IPv6-only network. You can see whether the DNS has changed to IPv6 format in the "Wireless LAN" of the mobile phone settings. You can also test it by visiting http://ipv6-test.com.

After simulating the network environment, run your app to see if the resolved IP is an IPv6 address and whether it can be accessed normally.

Unless there are special needs, it is best not to use IP directly, use domain name.

Peter_Zhu

Just map a domain name and it will be solved. If you write a fixed IPv4 address directly, it will definitely not support IPv6.
There are many ways to check, and Apple all conducts manual review. It should not be difficult to monitor the network communication mechanism of the APP.
But I don’t know exactly how the official does it.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!