Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

required iPv6 compatibility - iOS app rejected by apple

enter image description here

after June 1, I submit my ionic app to itunes connect and I got the message from apple.

Apps are reviewed on an IPv6 network. Please ensure that your app supports IPv6 networks, as IPv6 compatibility is required.

For information about supporting IPv6 Networks, refer to Supporting iPv6 DNS64/NAT64 Networks.

For a networking overview, please see About Networking.

I have used AFNetworking for API call.

Please help to find out the solution for the same.

Thanks.

like image 357
Ashish Ramani Avatar asked Jun 08 '16 04:06

Ashish Ramani


3 Answers

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

like image 76
gunjot singh Avatar answered Nov 06 '22 05:11

gunjot singh


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;

replace

AF_INET; to AF_INET6;
like image 12
Maninderjit Singh Avatar answered Nov 06 '22 05:11

Maninderjit Singh


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.

like image 7
Ashish Ramani Avatar answered Nov 06 '22 05:11

Ashish Ramani