How to allow my expo app to consume my API

16 Views Asked by At

I have a problem, i've developed an android app whit expo that consumes an API which i made whit express and it's listening in the port 8081 of the localhost of My computer. I've build the app whit eas and i install it in My phone. The app make requests to my API using this direction: http://192.168.0.19:3000/someendpoint. Where The firt number is my computer IP and The second number it's The port where My API server is running.The issue i'm having is that My app gets an axios network error each time it send a requests to my backend API. What i don't understand is why if a put that API direction in My phone navigator i can reach My API whithout problems, but when my app makes the requests it fails. I think it's because My API is on a http protocolo which is not safe but i'm not sure.

I have try to reach a public API from My app and it works, that is what make me think that the http protocol is the problem.

0

There are 0 best solutions below