Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49083

$http.get works on Android but not in IOS

$
0
0

@lugomulish wrote:

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.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49083

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>