I am working on ionic app which is supposed to make http request to an api. This means I cannot change server side settings. I am using the angular http module. My first attempt gave rise to a CORS error, I managed to fix by using a proxy like below:
"proxies": [
{
"path": "/api",
"proxyUrl": "https://api.com/api/"
}
]
This works perfectly fine in the browser when using ionic serve, however when deploying to a device the request does not seem to work.
When using the browser it give a status code 200 with a proper response. Response code
When deployed it seems looks like it returns the same response, however in the console the following error is displayed (this is retrieved using the remote devices in google chrome), also the response tab for the request is empty.
Edit: I checked the AndroidManifest.xml file and it contains the internet permission. However I tried to build it to android with the full URL instead of the proxy URL, but then the app unexpectedly closes.