Post

Replies

Boosts

Views

Activity

Get all available IP address of a device without using getifaddrs on iOS, iPadOS, tvOS, watchOS
Hi, My requirement is that I want to get a list of all IP addresses associated with all network interfaces on these Apple platforms - iOS, iPadOS, tvOS, watchOS. One of the approaches which will work for all the platforms is using getifaddrs API. I want to know whether there exists a native approach in either Swift or Objective-C which solves this problem. Official Apple documentation for getifaddrs API is kept in the archive section. Therefore, I am not sure whether it is a good approach to go ahead with or not. And I want to write the code in High-Level language as far as possible. So want to avoid using getifaddrs API directly as far as possible. I went through the classes/structs such as NWInterface, NWPath, NWPathMonitor. But was not able to figure out any API which will serve my purpose.
4
0
1.5k
Dec ’22