After quite a while trying to figure out why my android device couldn’t connect to my functions emulator on local host I finally traced through the code and found this section:
react-native-firebase/packages/functions/lib/index.js
Lines 96 to 102
in
decb6af
Which will work great for emulators, but breaks real devices since 10.0.2.2
is only within emulators. So ideally, you only want to run this code if it is running within an Android Emulator. Otherwise, if on a physical device it should be left as localhost
and reverse proxied via
adb reverse tcp:5001 tcp:5001
Thanks @mikehardy. I found a few things that morning. One was this behavior, and the other was a bug in the Firebase cli, so I suppose it’s partially positive?👍