Currently, I am in the process of developing an Ionic app. Interestingly, the app runs smoothly in the browser; however, when it comes to running it on the device, the HTTP requests fail to load. Upon inspecting the app using Safari remote debugging, no errors are displayed, and the network tab remains empty until a refresh is performed, after which the files are then listed.
An issue that I am encountering is related to the API request to the weather API, as it seems to be malfunctioning. The code snippet responsible for the request is as follows:
$http.get('http://api.openweathermap.org/data/2.5/forecast?lat=' + loc.lat + '&lon=' + loc.lng + '&units=metric&&APPID=XXX').success(function(weatherf) {
$scope.weatherf = weatherf;
alert("YUP");
}).error(function(err) {
$state.go("error");
});
Despite having the appropriate configurations in place, such as the white list plugin and the necessary entries in the config.xml file, the "YUP" alert and the error function are not being triggered. I am using Ionic version 1.7.15 and Cordova version 6.0.0.
If you require more information to assist with resolving this issue, please feel free to leave a comment. Your help and insights would be greatly appreciated!