i'm trying to retrieve the user's ip address from an external ip service. it works fine in the pc browser but it returns error 404 in the device. i've tried other external ip services but it ends up with the same error in the device. is there another way to get the device's external ip? how should i go about this?
here's my controller.js code:
$scope.findDeviceIP = function()
{
$http.get("http://ipinfo.io/json")
.success(function (data, status, headers, config) {
alert('data is = ' +data);
}).error(function (data, status, headers, config) {
alert("error = " + data + "status = " + status);
});
}
$scope.findDeviceIP();
and here's the error log:
error ip = {"data":"","status":404,"config":{"method":"GET","transformRequest":[null],"transformResponse":[null],"url":"http://ipinfo.io/json","headers":{"Accept":"application/json,text/plain,*/*"}},"statusText":"Not Found"}