Obtaining the location for multiple versions of Mac OS

I want to know if there is an easy way to get the coordinates of the location of a device, and that this way is scalable for multiple versions of Mac OS.

I want to develop an application focused on the location of the devices, which is compatible with multiple versions of mac.