I’ve been banging my head on this issue for 2 weeks. I CANNOT get an ion-list to bind in iOS - no matter what I try. I have no problem through the browser, or even an Android build.
A little bit more of a saga. After finally getting the tutorials to work on a device - I went back and tried to modify the angular code to call my stuff… Easily another 10 hours spent trying this and that - eliminating differences. I got it down to the point where the only difference was that I was calling my endpoint, vs. the tutorials. I was testing against existing API, so obviously the schema was different. I noticed that my date formats were slightly different… could that be it, I asked?
So I retooled that in another test service, and removed the dates. I was only returning two strings - first and last name. Worked great in the browser, and in the Android simulator. Could not get it to work on the iOS simulator or the physical device…
FInally, I said… OK. Let me try allowing CORS on the server. BOOM. That was it.
So, am I to understand that (even though the communication is from the App (on the device) right to the server (no proxies, etc)) - that I STILL must allow CORS on my server? Somehow, there is still some inner dependency on localhost - even fully installed on the device?
Is that safe / advisable / true? Will Ionic apps NOT work unless the server allows CORS? Seems like a big, potential deal breaker…
I mean, I understand that allowing CORS in development is easy and fast. But I’m not sure that I want to expose my API to potential security risks.
Does the “–prod” flag during compilation remove the necessity for CORS from native iOS to a WebAPI server? I haven’t tried that flag, yet. But I am ONLY able to bind to WebAPI data in iOS if I allow CORS on my server.