Skip to main content

fetch_geolocation

Function fetch_geolocation 

Source
pub fn fetch_geolocation(client: &Client) -> Result<GeoLocation, Error>
Expand description

Fetches an approximate geolocation for the current network connection.

This uses https://ipapi.co/json/ to resolve the device’s public IP to a latitude/longitude pair and an IANA time zone. The request times out after 10 seconds.