Apple iOS and the IPv6 deadline

Apple iOS and the IPv6 deadline

Starting on June 1, 2016, Apple will start enforcing a new policy that you may need to be aware of. If your app does any networking – opening a WebView, doing a network.request(), or using LuaSocket to talk to another server or device – then read on. If you’re not, you simply need to know the following:

TL/DR: All apps have to be IPv6 compliant after June 1, 2016.

A little history

For a long time, the Internet has used a four-byte (0255) IP address to represent each connected device. In network jargon, this is known as IPv4. You’re probably familiar with them as they look like 192.168.1.15. This pool of numbers is a worldwide resource and the Internet has run out of them.

For the past several years, the Internet has been moving to a different way to give your computer, phone, tablet, and smart device a unique address. This new system is known as IPv6 and it has a considerably larger pool of numbers which shouldn’t run out for a very long time.

Since the Internet is out of IPv4 addresses, there are now some resources that are only identified by their IPv6 addresses. Apple wants to make sure your apps all work with the new networking numbers. Starting on June 1, 2016, any newly submitted or updated apps must work on networks that only allow IPv6 addresses.

What does this mean for you?

You can no longer use IP addresses instead of server names. This applies to every kind of networking from WebViews to socket calls. Sometimes, it is just easier to use the IP address of a server (i.e. 192.168.212.15) instead of a server name (i.e. www.example.com), but this is no longer allowed. If you’re currently using IP addresses for your servers and need to switch, do an Internet search for dynamic dns and you’ll find a variety of services that will map server names to your IP addresses. If you have a domain name already, check out the DNS setup at your registrar which will let you set up your own mappings.

Corona SDK has two lower-level networking layers that your apps may be utilizing: the network.* API calls and the socket.* library. The network.* API calls have been IPv6 compatible for some time. If you’re using the latest public build and only use these functions, you should be in good shape from a Corona perspective. However, if you are connecting to servers using their IP addresses instead of a server name, you will need to stop using the IP address and use a server name instead.

If you’re using socket.*, you will need to get Daily Build 2016.2883 or later and rebuild your app. Essentially, this build has an upgrade to the latest LuaSocket library that supports IPv6.

How do you know if you’re using sockets?

If you are using third-party plugins or libraries, then you may need to make sure they work as expected. If you are doing any peer-to-peer connectivity (where to devices talk to each other without going through a network server), or are implementing your own FTP file transfer, then the library you’re using may need updating to avoid using IP addresses.

If you’re using LuaSocket, let’s look at some typical code that needs to be changed:

Since the socket.dns.toip() call only works for IPv4 addresses, it needs to be changed to the more modern equivalent:

If you’ve already changed over to (or started with) the more modern socket.dns.getaddrinfo() style calls, then you should be good to go.

Conclusion

iOS will be able to talk to IPv4 sites for the foreseeable future. However, if the only way your app uses the Internet is with IPv4, then Apple will not approve your app or any updates to it. Apple will not be taking any apps down, so you do not need to update existing apps. But any updates you do submit or new apps will be subject to this policy.

To learn more, read Apple’s developer documentation on the issue.

Rob Miracle
rob@coronalabs.com

Rob Miracle creates mobile apps for his own enjoyment and the amusement of others. He serves the Corona Community in the forums, on the blog, and at local events.

9 Comments
  • Mileni
    Posted at 01:01h, 28 May

    How will this impact Coronium? I can register a domain on DO, but is Coronium iPv6 ready?

    • Christian
      Posted at 08:48h, 28 May

      On DigitalOcean you can assign an IPv6 address to your droplet

      • Kevin
        Posted at 15:11h, 02 June

        After assigning a persistent IPv6 address on my droplet, I now have both the IPv4 and IPv6 addresses. Do you know if that satisfies apple’s requirement, since coronium still points to the old IPv4 address as an appId?

        • Rob Miracle
          Posted at 15:03h, 03 June

          Chris said Coronium is save with regards to using network.request(), but I don’t know if that IP address is getting passed to network.request or not. I would suggest asking in the Coronium forum at https://forums.coronalabs.com

  • Jeremiah
    Posted at 10:11h, 31 May

    This will likely have an adverse effect on any app using any of the old P2P libraries like AutoLAN since they don’t use DNS. Presumably, they can easily be upgraded to use IPv6 apis but someone would have to figure that out.

    • scottrules44
      Posted at 10:30h, 31 May

      I will have to test ,but I think the update to auto lan should still work. I have it in my game, which is coming soon. If anyone has any problems with auto lan, pm on fourms @scottrules44 or email me.

  • Max
    Posted at 13:48h, 01 June

    Thanks for the complete answer for that question.

  • Renato - Red Beach
    Posted at 09:43h, 10 June

    I had some serious problems using the Daily 2883 with the updated LuaSockets. More info here: https://forums.coronalabs.com/topic/63438-udp-socket-bug-on-daily-build-2883-and-later/