In my IONIC app I am accessing a server for login purposes. In android everything is happening fine, I am able to make XHR request and getting the response as well. In ios the call is not happening and the error that I am getting in web inspector are ->
- [Error] Failed to load resource: Origin http://localhost:8080 is not allowed by Access-Control-Allow-Origin. (login, line 0)
- [Error] XMLHttpRequest cannot load https://xyz.com/auth/login. Origin http://localhost:8080 is not allowed by Access-Control-Allow-Origin.
why this CORS error is occuring in ios and not in android. I can allow all clients to connect to the server by making : Access-Control-Allow-Origin = ‘*’ , but this is not secure. Help me please.