required iPv6 compatibility - iOS app rejected by apple required iPv6 compatibility - iOS app rejected by apple ios ios

required iPv6 compatibility - iOS app rejected by apple


If you are using IPv4-specific APIs or hard-coded IP addresses, you will need to update your code, Although all NSURLSession and CFNetwork APIs(including NSURLConnection) already support IPV6

As mentioned by Apple:

At WWDC 2015 we announced the transition to IPv6-only network services in iOS 9. Starting June 1, 2016 all apps submitted to the App Store must support IPv6-only networking. Most apps will not require any changes because IPv6 is already supported by NSURLSession and CFNetwork APIs.

If your app uses IPv4-specific APIs or hard-coded IP addresses, you will need to make some changes.

Although. Apple also recommends not to use IP Address Literals, for long term (Not necessary)

Don’t Use IP Address Literals

Make sure you aren’t passing IPv4 address literals in dot notation to APIs such as getaddrinfo and SCNetworkReachabilityCreateWithName. Instead, use high-level network frameworks and address-agnostic versions of APIs, such as getaddrinfo and getnameinfo, and pass them hostnames or fully qualified domain names (FQDNs). See getaddrinfo(3) Mac OS X Developer Tools Manual Page and getnameinfo(3) Mac OS X Developer Tools Manual Page.

Note: In iOS 9 and OS X 10.11 and later, NSURLSession and CFNetwork automatically synthesize IPv6 addresses from IPv4 literals locally on devices operating on DNS64/NAT64 networks. However, you should still work to rid your code of IP address literals

If you are using AFNetworking Library, Please make sure to update it to version above 3.x, as they seem to have updated few of the things. --> AFNetworking Added support for IPv6 to Reachability.

For Detailed Info, please follow this link

Supporting IPv6-only Networks

ALSO, TO TEST

You can follow this detailed tutorial:

tutorial-how-to-test-your-app-for-ipv6-compatibility


Solution for Apple app rejection due to IPv6 Network

My internet reachability check for IPv6 is not working well.It always shows absence of network.when I use this code ,apple approved my app within 24 hours. THANKS

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;}

EDIT:

$ grep -nr 'AF_INET*' ../Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.m:122:        address.sin_family = AF_INET;replaceAF_INET; to AF_INET6;


Actually i am calling API using AFNetworking Library.

I have just replace the AFNetworkReachabilityManager classes from Github with my existing classes. And apple doesn't have problem any more.

And my app works now.


matomo