I am making $http.post() call to grab content from my website.
I have declared:
<access origin="*" />
in my config.xml file. Apart, the PHP file, I am making call to, have
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept");
My function code looks like:
function loadFeed() {
$scope.show();
$http.defaults.useXDomain = true;
$http.defaults.headers.post['Content-Type'] = 'application/json;charset=utf-8';
var postUrl = 'https://wefemales.com/android/getFeed.php';
$scope.postUrl = $sce.trustAsResourceUrl(postUrl);
$http.post(postUrl)
.success(function (result) {
$scope.hide();
$scope.items = eval(result.data);
$scope.$broadcast('scroll.refreshComplete');
})
.error(function(status) {
alert(status);
$scope.hide();
});
}
$scope.doRefresh = loadFeed;
loadFeed();
});
Now when I test the project in chrome using ionic serve its works all perfect, but when I test it with my Galaxy Tab 3, it returns status code: 0
I have spend around two days looking for the solution but still with nothing.
One more thing, my CordovaApp-debug.apk works fine though, problem comes when I sign the application using jarsigner and zip align it.
Please, if someone could help me out with this, that would be great.
I am new to ionic/cordova, but a quick learner.