-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return country & city information in addition to coordinates #46
Comments
@Nurou Thank you for reaching out. So far I have intentionally removed this as it encourages abuse of the service by people who actually have no interest in prayer times but want to reverse engineer co-ordinates. We can always add authentication to the API, but that's something I have stayed clear of thus far. Which endpoint are you using? |
Thanks for the response and that's a fair point which I hadn't considered. The endpoint I initially call is (using IP location info): http://api.aladhan.com/v1/timingsByCity/city=${city}&country=${country} If/when the user grants geolocation info, I fetch times using the following endpoint: http://api.aladhan.com/v1/timings/null?latitude={lat}&longitude={long} But, now I've lost information about the city since the geolocation API doesn't return it, and neither does the adhan endpoint. I need it to update the UI so the user knows which city the time is based on. |
OK, give me a few days to think about it. Are you making your call client side or server side? Basically all machine to machine authentication become useless if the call is done purely on the client side. Also, you can drop the null from the second api call. /v1/timings?latitude.... should work just fine if you're always getting the time 'now'. |
Yeah, sure. I make all calls client side (I'm not running a server). |
@Nurou I am working on a solution for this. Thanks for your patience. |
…d location for non geocoding endpoints. #46
Since the project uses Google Maps API for the geocoding, it would be useful to also get the country and city data in the response alongside the coordinates currently being returned.
When getting times by coordinates (geolocation API), I need to additionally reverse geocode the coordinates in order to know what city the times are for. It'd be great to have the available directly from the response.
Thanks!
The text was updated successfully, but these errors were encountered: