Ionic 3 consuming api after build

0

Next I have an api running already, and I can do the requests quietly by using ionic chrome extension allow access-control-allow-origin , and I have all the right answers, but when I gave build in my project by xcode , and I tried I want to do the requests for xcode / emulador , with app installed, it did not work, can anyone help me what can I do? to fix this? type should I declare in xml something?

My xml

<content src="index.html" />
<access origin="*" />

my webservice with the request

login(conta: ContaInterface)
{ 
return this.http.post(this.url+'api/userLogin',{
"email": conta.email,
"password": conta.password},{"headers": {'Accept':'application/json'}}); 
}
    
asked by anonymous 06.04.2018 / 20:38

1 answer

0

I believe you have to release CORS in your API (on the backend).

If it is done in php you will do something like

 <?php
 header("Access-Control-Allow-Origin: *");

Look for how to release CORS in the programming language you wrote the API.

I hope I have helped.

    
07.04.2018 / 02:49