Related: https://linear.app/comm/issue/ENG-2705/expo-cli-qr-code-doesnt-use-the-right-lan-ip-address
Because we run expo start with the --dev-client flag, but we don't have defined a custom Linking URL Scheme, Expo CLI defaults to localhost.
This diff patches @expo/cli and overrides this behavior.
- Try to autodetect the IP using some utility from the package
- If failed, try to read the IP from native/facts/network.json
- If we fail again (require fails or natDevHostname doesn't exist), leave "localhost"
On the other hand, maybe it's worth stopping relying on network.json, as stated in https://linear.app/comm/issue/ENG-2707/replace-nativefactsnetworkjson-with-code-that-detects-lan-ip-address