i’m french and my english is not perfect, so sorry for that.
I have an issue with $http in my hybrid app (principle: it gets a list of business near you, with a call to an external api, mine, which return the list in json)
with ionic serve on my computer it’s okay, the cross-domain request works, with ionic view on my Android device and on iOS device, it works too. But when i build an apk for Android an install it directly (on Android 4.4.2), it doesn’t work. I have an error status 0.
The domain called is mine, i have put at the start of the php file returning the json:
header("Access-Control-Allow-Origin: *");
I have also installed cordova-plugin-whitelist in my project and added <allow-navigation href="*" /> in the config.xml file. But nothing seems to work and i think i have made the turn of the solution i’ve found.
Have you used Chrome remote debugging to your device plugged in your USB port?
If you haven’t, then this is a the best solution to know what’s going on.
Could you try the above code? I noticed that angular sends a request before the actual GET, using slim it gave problems to me, so i just forced it to respond with a HTTP200 code.
What do you mean by “the directive were not applied”. I have the same problem, that is works in browser, works on ionic view, doesn’t work when apk installed on android