Hi guys.
I have completed an application for Android with ionic and works perfect, but when I try to generate the same application for IOS I have trouble making get requests with " $http.get " I share my code.
$http.get(ENV.apiEndpoint + 'api/token/' + uuid) .success(function (data, status) { alert("success"); if (data.token) { $rootScope.token = data.token; } deferred.resolve(data); }) .error(function (response) { alert("failed"); deferred.resolve(response); });
I have added two alerts for .success and .error but do not work well , Apparently nothing in the $ http.get works… However if I put alerts before and after the $ http.get the alerts work properly.
I have installed the whiteList plugin and have this code in the config.xml file.
<access origin="*"/> <allow-navigation href="*"/>
But I don’t know if I need extra configuration for IOS.
Any suggestion??
PD:The same code works in Android.