victor / whereami

get your location from the command line
http://victor.github.io/whereami/
MIT License
213 stars 24 forks source link

Location Exception Handling #4

Closed grouver closed 12 years ago

grouver commented 12 years ago

On Lion, location services ask you to allow the usage of the service. Anyway not such a bit issue and there really isn't any way you can circumvent that. The issue however is that if for whatever reason the location services are not allowing the coordinate report to proceed (like say you clicked on the wrong dialog button) you get an unhandled exception:

The operation couldn’t be completed. (kCLErrorDomain error 1.): (null)

It's and easy fix and all you need to do is set the program to exist in case of the error. Maybe you can add a notification message too. Sorry I can't write the patch code at the moment but I'll be away from anything that has xcode installed on it for the next week or so.

victor commented 12 years ago

Thanks for the report. This is definitely a needed improvement.

grouver commented 12 years ago

no, thank you for writing the program. I found it very useful for setting up cron jobs based on location even if Apple doesn't give you an option to bypass the popup authorisation stage.

victor commented 12 years ago

actually, it should only ask you the first time, if you select to always allow it (I developed it on Snow Leopard. This may now be different on Lion, perhaps it needs to be sandboxed now); allowing its use in scripts.

grouver commented 12 years ago

you are correct, it only asks the first time within a 24 hour period. As far as I know, there is no way for you or anyone else to escape that check. It is related to a privacy concern as in Apple thinks that you should know when something on your computer is tracking you (if you use their APIs). It's not the end of the world though and I don't think there's anything you should worry about :)