With Unity Version 2019.2.7 System.Net.NetworkInformation.NetworkInterface is broken when built to iOS.
Traversing through all NetworkInterfaces (with NetworkInterface.GetAllNetworkInterfaces()) gives a list of all networks, but…
- NetworkInterfaceType is ALWAYS 0 (instead of for example: NetworkInterfaceType.Unknown, NetworkInterfaceType.Ethernet, etc.)
- OperationalStatus is ALWAYS Unknown
- GetIPProperties().UnicastAddresses is ALWAYS empty
This bug was first introduced with Unity Version 2019.2.7 and still exists in Version 2019.2.9
In Unity Version 2019.2.6 everything is working.
NetworkInterface[] networkInterfaces = NetworkInterface.GetAllNetworkInterfaces();
foreach (NetworkInterface network in networkInterfaces)
{
IPInterfaceProperties properties = network.GetIPProperties();
Debug.Log("Network: " + network.Name +
" Interface Type: " + network.NetworkInterfaceType +
" Operational Status: " + network.OperationalStatus);
foreach (IPAddressInformation address in properties.UnicastAddresses)
{
Debug.Log("IP Family ... " + address.Address.AddressFamily +
" Adress: " + address.Address);
}
}
Unfortunately downgrading isn’t an option, because Apple will reject all builds with Deprecated API Usage of UIWebView. This was fixed this with Unity Version 2019.2.7, but now the System.Net.NetworkInformation.NetworkInterface is broken, and I can’t get the local IP-address of the device, which I need in my game.
I’ve already submitted a bug report, but neither get an answer nor a confirmation email.
Can please somebody @ take a look into this? Are you aware of this problem?