batoulapps / Adhan

High precision prayer time library
MIT License
329 stars 63 forks source link

auto detect coordinates #65

Closed sabrefm1-zz closed 7 years ago

sabrefm1-zz commented 7 years ago

Is there a way for the app to automatically detect the coordinates list below here let coordinates = Coordinates(latitude: 35.78056, longitude: -78.6389)

as if when the app asks you to allow permissions to use location

z3bi commented 7 years ago

You can do that using Apple's Core Location functionality. You can read more about it here https://developer.apple.com/library/content/documentation/UserExperience/Conceptual/LocationAwarenessPG/CoreLocation/CoreLocation.html

sabrefm1-zz commented 7 years ago

would that have any affect on the time of the prayer?

z3bi commented 7 years ago

Yes, prayer times are different for every location.

sabrefm1-zz commented 7 years ago

how would you then link the core location to prayer times do you have any tips on that. since in the code coordinates are manually set

z3bi commented 7 years ago

Once you implement Core Location you will get back coordinates, when you do simply give them to the library like the example shows but instead of using the hardcoded values, use the ones provided by the Core Location API.