So, i have cloned the tutorial app repo from ionic. I ran
ionic start conference sidemenu
and then i added a simple $http.get('myserver')(I tried with ngResources too).
It worked perfect on chrome, I got all the data back but on angular i only got null data and 404 status on any request I tried to do.
Note: I tried with my hosted server and with a local one. Both fail on Android. Server is a node.js REST API.
Nothing is printed on the console, so the request does not even get to the server.
Has anyone experienced that or could tell me how can I debug Android apps built with Ionic?
EDIT 1: I don`t know why do you need it but here it is
$http.get('http://server.com/route').success(function (data) {
//handle success
}).error(function (data, status) {
// handle error
});
The local content you should, when cordova compile is a www folder, they are there assets and other folder for you implement the apk or equivalent iOS
i.e
The thing is that there were some major changes in Cordova 4.0.0:
So I installed the Cordova Whitelist plugin. And added
in my
config.xml
file.This sounds like you use crosswalk. In that case this will help you: http://forum.ionicframework.com/t/crosswalk-and-http-doesnt-work/20275 I suggest reading the whole thread before changing anything.
In my case, the problem was with
cordova-plugin-whitelist
plugin. I just removed the plugin and added it. Also enabled any requests by adding this code<access origin="*" />
inconfig.xml
. Please find below commands:You need to remove existing plugin by using below command:
Then just add it by using below command:
Hope it helps.