0

I am creating an application with Flutter and it needs IPv6 compatibility for App Store. My server is using a IPv4 address, and the application is working as intended when the client is in IPv4 network. The server (Python) creates a socket for IPv6 addresses (AF_INET6) and Dart has

static Future<RawDatagramSocket> rDgS =
      RawDatagramSocket.bind(InternetAddress.anyIPv6, [port number]);

I am using UDP.

Can I connect a client from a IPv6-only network to my server that uses IPv4 address? The server has both IPv4 and IPv6 addresses available, but currently only one can be used.

Is it possible to check the client's connection type (IPv4/IPv6) using Dart (Flutter) and then connect to the server using the correct IP-address? If yes, how?

If this works, I assume it works for both Android and iOS devices?

Currently, I am unavailable to create a IPv6-only network to test the changes and I am trying to get it working. Since I am working with a tight schedule, I am asking this in advance.

  • "_Can I connect a client from a IPv6-only network to my server that uses IPv4 address?_" No, and that is not the point of the requirement. Read the [Apple document](https://developer.apple.com/support/ipv6/) about it. Your application must be able to support IPv6, but the server does not need to be IPv6-enabled (although you are foolish not to do that today). – Ron Maupin Nov 12 '22 at 21:16
  • Does this answer your question? [Apple App Store IPV6 Requirement](https://stackoverflow.com/questions/48339092/apple-app-store-ipv6-requirement) – Ron Maupin Nov 12 '22 at 21:16
  • Thank you for the reply. I understand that hard-coding IPv4 address is not suitable. So is that the issue, if my serverIP -variable is the IPv4 address for the server? It is hard-coded at the beginning of the mobile app's Dart file which communicates with the server. This sends a message to the server:```udpSocket.send(data, InternetAddress(serverIP), [port number]);``` – Antte Heatta Nov 12 '22 at 21:35
  • Hard coding IP addresses under any circumstances is a really bad idea, even without Apple's requirement. We have had DNS for many, many years. Use DNS to get the address, then you can support either or both IPs. The point is to make that application IP-agnostic by removing any dependency on which of the two IPs is used. – Ron Maupin Nov 12 '22 at 22:13

0 Answers0