macoscocoacore-foundationcaldavaccounts

macOS: Add CalDAV account (Settings/Internet Accounts/CalDAV account) programmatically


Does anybody know how to programmatically (headless in Objective-C/C++, NOT by using NSAccessibility, AppleScript or any other technology accessing the UI) add a CalDAV account to the macOS system?

Manually this ca be done in System Preferences > Internet Accounts > Add an account > Add Other Account... > CalDAV account.

So far I have only found the Accounts framework, but there are no constants or any other hints how to add/create a CalDAV account.

Regards, Dominik


Solution

  • At this point there is no API for doing this, but you may be able to add the account using a so called "configuration profile".

    To read more about this: Configuration Profile Reference