1

how to get current location using internet ?

i'm making an application where i necessary need the latitude and longitude of user.

Would anyone please tell me if i off the iPhone location service from settings and

i want to get current location from internet not from the GPS then how can i get it

in iOS?

is this possible in latest iOS ?

I used the Core Location framework.

If any one having any idea please share with me.

Like in Android they use something like this

isGPSEnabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);

isNetworkEnabled = locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);

so i also want to get location if the location service is OFF.

Thanks in advance.

Bhavin_m
  • 2,746
  • 3
  • 30
  • 49
zeeshan shaikh
  • 819
  • 3
  • 18
  • 33

1 Answers1

0

there no any apple sdk but you use HTML5. call this html from your native code and get response to handle

<!DOCTYPE html>
<html>
<body>
<p id="demo">Click the button to get your coordinates:</p>
<button onclick="getLocation()">Try It</button>
<script>
var x=document.getElementById("demo");
function getLocation()
  {
  if (navigator.geolocation)
    {
    navigator.geolocation.getCurrentPosition(showPosition);
    }
  else{x.innerHTML="Geolocation is not supported by this browser.";}
  }
function showPosition(position)
  {
  x.innerHTML="Latitude: " + position.coords.latitude + 
  "<br>Longitude: " + position.coords.longitude;    
  }
</script>
</body>
</html>
codercat
  • 22,873
  • 9
  • 61
  • 85