


What you should do is create a Virtual Host. Localhost won’t work from your phone, because localhost on your phone is the phone itself, and localhost on the laptop is the laptop. I had been using the IP address i found when I googled “what is my IP address” since I didn’t know there were different types/purposes.Īfter following the instructions on this site ( get your LAN IP address in MacOSX), and I have fixed the issue and can attest that using my LAN IP address allows my iOS simulator, iOS physical device, AND android simulator to successfully connect to my API.Īs a reminder, you’ll have to use the LAN IP address in the baseURL in client.js in the client AND assetsBaseUrl in development.json in the API.Īfter following the instructions on OS X daily ( get your LAN IP address in MacOSX), I was able to fix the issue and can attest that using my LAN IP address allows my iOS simulator, iOS physical device, AND android simulator to successfully connect to my API.Īpps in production will typically connect to a HTTPS domain with an SSL certificate, and not an IP. The same person who posted the above mentioned message then said that you need to use your computer’s LAN IP address. I then found a post in the React Native Developers discord channel where someone said that you can’t fetch from localhost because localhost is your own phone (if you try using localhost and running the app on your own physical iOS device, you’ll see that you still get the network error even though it works in the simulator).
#Proxyman localhost for android
I was able to use localhost and 127.0.0.1 (just learned they are the same thing) but as Mosh said, using localhost won’t work for android devices. Hey everyone so I was getting the Network Error before, and couldn’t figure out why it wasn’t working.
