Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getIPAddress() returns 0.0.0.0 when testing on a real device on cell service? #496

Closed
hsunami10 opened this issue Sep 19, 2018 · 6 comments

Comments

@hsunami10
Copy link

Running DeviceInfo.getIPAddress() when testing through Xcode on a real iOS device returns "0.0.0.0" as an IP address when on cell service? All versions of everything are on the latest, and everything is correctly linked (manually)

@ivansifrim
Copy link

Same - @hsunami10, thoughts?

@lysuse
Copy link

lysuse commented Apr 3, 2019

Android devices with wired ports have the same problem。

@mikehardy
Copy link
Collaborator

Have you read the docs related to the APIs in question? I know there are moves to limit visibility on networking info without special permissions (and special scrutiny) in some Android versions, maybe it's the same with iOS? When you say "all versions of everything are on the latest" that isn't very helpful unfortunately. For any problem report to be reproduced we need the versions of everything in use - react-native, this module, device operating system etc.

@mikehardy
Copy link
Collaborator

We're going to work together with react-native-netinfo to get this functionality built in that package - not closing this yet, but keep an eye on that repo as well

per #635

@mikehardy
Copy link
Collaborator

I just looked at getIPAddress and it's just looking through wifi, not cell, so I suppose that makes sense. https://github.com/react-native-community/react-native-device-info/blob/master/ios/RNDeviceInfo/RNDeviceInfo.m#L302

I would say the react-native-network-info package has a stronger implementation of this feature if it is a requirement for you, in their getIPV4Address method: https://github.com/pusherman/react-native-network-info/blob/master/ios/RNNetworkInfo.m#L168

@mikehardy
Copy link
Collaborator

Our network information features will be re-homed to react-native-community/netinfo so I'm resolving this in favor of the tracking issue there for non-wifi interfaces: react-native-netinfo/react-native-netinfo#52 - note that the react-native-network-info module is still the best API provider at the moment for this info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants