Search code examples
iosiphoneapp-storeipv6appstore-approval

How to setup an IPv6 only network for iOS app testing?


The first time I got to read about the mandatory support for IPv6 only networks in all new apps to be released in the AppStore was yesterday, when my app got rejected with Apple stating this as the reason.

So, I have been trying to reproduce this from my end. I have gone through the Apple's guide for the same and have setup a NAT64 network and connected my iPhone to it (screenshot).

But, when I get over to test-ipv6.com or any other websites to check IPv6 connectivity on the device, it shows "No IPv6 address detected" message. Also, I am unable to load ipv6.google.com which reportedly loads up only on IPv6 networks (please correct me if I'm wrong).

Am I missing something, or is there anything else I can do to test my app for IPv6 only network compatibility?

P.S: My app worked and the pages loaded up fine when I tried in this NAT64 network. But, in the Apple's rejection reply, those APIs ended up failing.


Solution

  • are you using AFNetworking? If yes, update your classes. Change the following line in code in AFNetworking Library in Class AFNetworkReachabilityManager

    CHANGE AF_INET TO AF_INET6;

    + (instancetype)sharedManager {
        static AFNetworkReachabilityManager *_sharedManager = nil;
        static dispatch_once_t onceToken;
        dispatch_once(&onceToken, ^{
            struct sockaddr_in address;
            bzero(&address, sizeof(address));
            address.sin_len = sizeof(address);
            address.sin_family = AF_INET6;  //Change AF_INET TO AF_INET6
            _sharedManager = [self managerForAddress:&address];
        });
    
        return _sharedManager;
    }
    

    Otherwise, what classes or library are you using for networking?

    Edit: As you requested, here is a tutorial on how to test your app and check if it is ipv6 ready:

    http://www.brianjcoleman.com/tutorial-how-to-test-your-app-for-ipv6-compatibility/

    Alternate link over Waybackmachine

    It covers the creation of an IPv6 NAT64 only network in your mac then sharing internet connection from your mac to your other wifi (or bluetooth or whatever) devices.

    Then you can make all the tests within your app, being sure that all calls are made via an ipv6 only network.

    Edit2:

    Those website WON'T BE ABLE to see your ipv6 ip adress. If you used that tutorial, the ipv6 adress is a private (internal to your network) adress. It is used to communicate between your iPhone and your mac. What internet websites see is your PUBLIC ip, which is given to your modem by your internet service provider, and which is generally an ipv4 network.

    So to conclude: your app is working with its ipv6 adress. Those test websites won't detect it because they only see the public adress of your router / modem.

    Please refer to This link to read more about public vs private ip addresses.