@sylviolam wrote:
Hi,
my app does not work anymore. in ionic 3 it worked, now with ionic 4 is occurring error in the request.
The get request does not enter the server.
My function on the server:
public function test_app ( username = null, key = null) {
header (“Access-Control-Allow-Origin: *”);
header (“Access-Control-Allow-Headers: *”);
json = '{"a": 1, "b": 2, "c": 3, "d": 4, "e": 5}'; return json;
}Ionic:
return new Promise ((resolve, reject) => {
let url = this.API_URL + ‘/ test_app’;
this.http.get (url).subscribe ((result: any) => {
resolves (result.json ());
},
(error) => {
reject (error.json ());
});
});In the browser (ionic serve) is working normally, android does not work
help me please?
Posts: 2
Participants: 2