The Official Ionic Blog

Build amazing native and progressive web apps with HTML5

Howdy, folks! So by now, you’ve heard about how as of June 1, 2016, Apple is forcing apps to use IPv6 and figured out what that means for your app. Oh, wait…you haven’t? Ah, OK. Well, thankfully, this article covers some of the details. Take a read–I’ll just wait here for you.

Hey, you’re back! All right, let’s get into what this means for your app.

Some background

During development of your app, you’ve probably made an HTTP request or two. It’s a fairly standard practice. Sometimes you’re even able to build out your own API and control that, as well as your app. But chances are your API is built on IPv4, and as of this summer, Apple has made the move to require all APIs to use IPv6. So what does this mean, and why do you need to do this?

What Apple’s rules mean for your app

For the most part, developers really shouldn’t have to do anything! Apple’s rules state that in a IPv6-only environment, your app needs to be able to work. For your custom APIs, your hosting provider should support IPv6, as well as IPv4 at the same time.

The only caveat to this is if you hard-code a IP address, which won’t pass Apple’s IPv6 test. You’ll need to switch the IP to the hostname, instead.

But I’m not hard-coding an IP address! What should I do?

If you happen to be using a hostname but still run into issues, chances are you API is not available through an IPv6-only environment. In this situation, you should either reach out to your hosting provider or create a middleware that is hosted on a IPv6 reachable service, like Digital Ocean.

A brief history lesson on IPs

Back in the 1980’s, when the internet was still ARPANET, computers needed a way to figure out how to send data from one point to another. IPv4 was created to map out every possible end point. This is the standard IP address that we know and love today. IPv4 has its limits, though, as it only allows for roughly four billion unique addresses. This may sound like a lot, and in its era, it was. But it’s very clear that four billion isn’t a large enough number when you consider the internet of today and tomorrow.

IPv6 to the rescue

IPv6 resolves this issue by replacing IPv4 32-bit addresses with 128-bit. This means it can support 2^128 addresses. If you do the math, that’s well over several trillion addresses. That’s quite a bit more than four billion! Aside from the increase in available addresses, endpoints can also auto-configure their own addresses. This makes IPv6 much more flexible, compared to IPv4.

Parting thoughts

While it may seem sudden and brash for Apple to do this, IPv4 full replacement is inevitable. Instead of dealing with this “down the road,” Apple has decided to be proactive, which is good. Hopefully this clears up any confusion or questions.

  • Niek Weevers

    What does this mean for existing apps in the app store? Or is this just for new apps?
    Https is also required, isn’t it?

    • Mike Hartington

      Apple appears to be going on a spree to make sure that existing apps follow their new guidelines. If you have an app that is in the store, you should update it. As for HTTPS, you should be using that anyways.

      • Niek Weevers

        Thanks. And totally agree with your last sentence

  • Keith D. Moore

    It appears it is more than just making sure you are not using hard-coded IP addresses. According to this post: You can use cordova-HTTP plugin to get around the app rejection. Also, see this:

    • Keith D. Moore

      Update: Recently, we had no issues with IPv6. No need to use the cordova-HTTP plugin or secure-HTTP plugin. We also did not have any hard-coded IP addresses in our API. Our backend however does NOT support IPv6 so we were a little worried about it. Not an issue apparently.

  • SubjectiveEffect

    Confused. June 2016 has passed.

    • Keith D. Moore

      Correct. And some apps are being rejected due to IPv6 issues.

  • Juan Cabral

    What I can’t understand it is where I have to change things, I have to modify my app or just enable ipv6 on my server?

    This is where I get lost

  • Moises Valera

    Every update in my app was fine until i started using ionic cloud for nitifications and deployments, since then my app is getting rejected by IPv6 network issue.

    i don’t really know what to do, help please…