Determine if current network supports IPv6?

I found that Apple Store only allows apps that support IPv6. My application is written using posix style low level c sockets, and there is no way at this point in development to change those to higher level networking API's that are agnostic in their IP layer protocol.


However, the libraries that I am using support both IPv6 and IPv4, just using different API calls. So, my question is how, using Objective C or C, do I determine if my current network (WiFi, LTE, etc) supports IPv6.


I could technically achieve this using a remote API call, but I'm trying to avoid tihat if possible and instead determine it locally.

Replies

Did you read Apple's transition guide? https://developer.apple.com/library/content/documentation/NetworkingInternetWeb/Conceptual/NetworkingOverview/UnderstandingandPreparingfortheIPv6Transition/UnderstandingandPreparingfortheIPv6Transition.html#//apple_ref/doc/uid/TP40010220-CH213-SW1

While the guide does spend a fair amount of time in "Please use the high level API to make your life easier" mode, about half way through it starts outlining the expected fallback sequence and suggestions.

While that document tells me in one spot that i can use `getaddrinfo` to synthesize an IPv6 adress, further down it says

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.