search

Home  >  Q&A  >  body text

Objective-c - How does an iOS device know whether the current network is IPV4 or IPV6?

As the title states, the server my device currently accesses is through IP plus port.
This time Apple audits the network that Apple requires to support IPV6.
How to judge in the device? The server needs to be set. ?

为情所困为情所困2807 days ago1414

reply all(2)I'll reply

  • 为情所困

    为情所困2017-05-02 09:31:30

    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.

    reply
    0
  • 天蓬老师

    天蓬老师2017-05-02 09:31:30

    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.

    reply
    0
  • Cancelreply