@javasol wrote:
I have an ionic 4 app that uses HttpClient from @angular/common/http version 5.0. It’s connecting to a spring REST server to get data. The login and subsequent REST calls work fine in all environments except for IOS Simulator. I wouldn’t care if it works on Simulator since I use the combination of ionic serve and an actual device to test, but it seems like the itunes approves also use simulators because they are rejecting the app saying that they cannot login.
The issue isn’t logging in, login is successful. It seems like for some reason the session is being lost in between login and the next few REST calls. If there’s something wrong with my code or setup, wouldn’t it fail on other systems?
This works on:
IOS, actual devices
Android, actual devices and emulators
Browser, ionic serveDoesn’t work on:
IOS SimulatorCall after login:
let url = SERVER_URL+"/getEmp"; return this.httpClient.get(url, {withCredentials: true});
Response:
ERROR: In handle error. Http failure response for http://192.168.1.156:8080/getEmp: 401 Unauthorized 2018-08-06 23:02:30.532936-0400 My Mobile App[] ERROR: Unauthorized
Posts: 1
Participants: 1