Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | PerduGames | |
Old Version | Published before Godot 3 was released. |
How do I get IP on Android? I’m trying with:
IP.get_local_addresses()
But it is not working.
Up 1:
I got it here, it’s some other mistake in the project, I’ll check it out. But in an empty project with just that, it worked correctly, the only problem is that it gives me an array, and I want to get the local ip ip4, and in android it stays in one position, and in the other debian, it has some better way or I’ll have to Check the platform on which I am and this will only change platform or device to device?
Make sure that you have INTERNET
and ACCESS_NETWORK_STATE
permissions.
timoschwarzer | 2017-07-24 04:24
It is working, the problem is that as I get an array that has the ips in different rows depending on the platform, which I hope is only platform, because if this switch from device to device will be more annoying to verify.
PerduGames | 2017-07-24 04:52
Just a guess, but I think you are getting the IP of every network interface present and/or enabled (cell data, Wi-Fi, etc.). Not sure about the enabled part, but the thing is that you have to expect a different number of results at least among devices.
With more info about your use case we may give you further advice.
RandomShaper | 2017-07-26 22:38