Ionic request doesn't work only on IOS

Hi all, i have an app with ionic and Angular that work fine on web and on Android device but i have this error on IOS device:

[error] - ERROR {“headers”:{“normalizedNames”:{},“lazyUpdate”:null,“headers”:{}},“status”:0,“statusText”:“Unknown Error”,“url”:“xxxxxxxxx/competition/getall”,“ok”:false,“name”:“HttpErrorResponse”,“message”:“Http failure response for xxxxxxxx/competition/getall: 0 Unknown Error”,“error”:{“isTrusted”:true}}

where xxxxxxx is my base address.
Where is the problem and how i can solve?

Can you give some more details what are you trying to do ?

In general API calls are not dependent from systems but from request.
Are you giving the proper/same request for the call ? (compare with web version).
Maybe you are using some data from storage and its not working in IOS ?

Hi, in this case no usage of storage.
The first call opening the app is a simple GET that work correctly on the web.

I paste here the request:

You can test in browser and it work fine.
If i try the IOS app on xcode emulator i have this error:
[error] - ERROR {“headers”:{“normalizedNames”:{},“lazyUpdate”:null,“headers”:{}},“status”:0,“statusText”:“Unknown Error”,“url”:“",“ok”:false,“name”:“HttpErrorResponse”,“message”:"Http failure response for 0 Unknown Error”,“error”:{“isTrusted”:true}}


It’s cors problem
On IONIC CAPACITOR it must be added to server side CORS to enable this:

1 Like