I'm using macos Rider to develop a Xamarin app for Android and iOs. I have a local api that I'm trying to use via the app, but it appears that the app cannot reach the api. This happens on Android as well as on iOS.
Focussing on Android, I have tried changing the api to http://10.0.2.2:5000
. The thing is, I can access the api endpoints when using the emulators browser, but trying to do so via the app, it gets stuck on loading.
When using the iPhone emulator, I get the error that I should use SSL in order to access the api via the emulator.
I've tried to debug on Android in order to find out whether the api is actually the issue here (I find it weird that I can access it via the emulators browser), but I'm unable to figure it out because there is no exception thrown. When reaching the code below, it appears as if it simply 'stops'.
To sum it up, some facts:
- The app breaks down on iOS and Android
- The api is running, and I've tried
http://10.0.2.2:5000
for Android,http://localhost:5000
for iPhone. I can reach the app via both emulators browsers and via Postman. This gives me results as well, so nothing appears to be wrong with the database or the api for that matter. - I'm using a Mac (Jetbrains Rider)
- It does work when I use the same api that is running on a server