-
Notifications
You must be signed in to change notification settings - Fork 55
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
How to get access to Reminders in anything else than Terminal #68
Comments
thanks for the kinda words. i don't think there is anything we can do here, you'll probably just have to manually add it there if the popup doesn't happen |
Hi @keith, apologies for cropping the screenshot too much, but in the full view you'll see you can't add apps manually: (no plus in the Compared to e.g. Full Disk Access where you can add app by using the plus in the bottom left Non of the apps outside of terminal trigger asking for access permission |
oh bummer. afaict there's no alternative API for us to be calling https://developer.apple.com/documentation/eventkit/ekeventstore?language=objc |
Ok got it. Not an area I'm familiar with so unfortunately not something I can help with. Thanks for thinking along! |
I think it's up to macOS to prompt for this stuff so I'm not sure why it doesn't in some cases. Maybe when we ask and it fails the app appears there but disabled? |
So I tried in in different app, e.g. Visual Studio Code. It fails without showing a prompt as discussed, but then doesn't how up in the MacOS settings (shown above) unfortunately. It looks like the asking for permission in those apps is not working? |
What OS version were you on with this? I started seeing this with Sonoma and have a fix |
Fixed my case in #70, if 2.4.0 doesn't fix this for you please comment with the error that is now printed and we can try to find a fix. |
Hey @keith, I'm on Sonoma too now: Just tested again and these are the outcomes. It works perfect if I use my terminal (in this iTerm) When I use any other program (in this case VSCode) it exits with your new error I'm not prompted when running in VSCode to allow VSCode to access Reminders & in the privacy settings I still can't add any program manually |
I guess the lack of an error in the second screenshot means There wasn't an actual error and it really is just a permissions issue. |
Indeed, if I read the code correctly it looks like there is no error |
I tried this too and see the same. Previously https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard solved this, but it doesn't seem to help in this case. It must have something to do with how VSCode spawns its terminal |
When I access the Mac via ssh (Sonoma) and call reminder-cli, I get the same error message. |
I tried debugging the ssh case a bit, the problem seems to be that the requesting process is the ssh tool. I tried codesigning the reminders-cli binary w/ the proper entitlements to see if that helped but it did not. If anyone finds a workaround for this type of case I'd love to hear it. To debug you can open Console.app, stream logs, and search for tccd. The failing lines in my case debugging ssh looked like this:
There are some unsupported ways around to try and add something to the tcc db from the command line but I haven't treid any of them https://forums.developer.apple.com/forums/thread/119373, it's possible that if you add whatever app you're launching reminders-cli from that it would start working. Let me know if you find any workarounds! |
I figured out how to get permission in vs code or other non terminal.app terminals to my apple reminders, so drop that into README. Figured out from keith/reminders-cli#68 (comment)
First of all @keith, great tool, works flawlessly! 🙏
The only caveat is that it only work directly in Terminal. If it's being called from any other application you get the "You need to grant reminders access" error generated by the app.
I've looked at #58 (it was solved through Apple Script: is too hacky for my purpose), #13 but that discussion is stale, #4 is related but too much on a programmatic level.
My request is that this app is usable by other apps than the terminal.
My assumption is that the code
`public static func requestAccess() -> Bool {
let semaphore = DispatchSemaphore(value: 0)
var grantedAccess = false
Store.requestAccess(to: .reminder) { granted, _ in
grantedAccess = granted
semaphore.signal()
}
`
works in the terminal and indeed requests access to Reminders, which you can later see here:
Maybe the code can be improved to work also when being called by other apps, and in this way asks permission to the user to grant the current app permission to access Reminders, so it will show up in the list above.
(Not a Swift programmer so there are some big assumptions I made 😅)
Thanks again for your great work 💪
The text was updated successfully, but these errors were encountered: