Handling permissions in a Swift Library

I am developing a dynamic library in Swift for MacOS that will be used by another app as a plugin. The app is not written in Swift and I cannot access its source nor modify it.

The problem is that my library should provide access to the Calendar using EKEventStore, but then I can't seem able to requestAccess to the library since the application which will be using my library as a plugin doesn't have the necessary NSCalendarsUsageDescription entry in its Info.plist (it's not even written in Swift) and it seems I cannot just specify such an entry in the Info.plist of my library.

What is the recommended way to give calendar access permission to a library? Or otherwise, is there a way for a library to modify the access requirements of an app?

Replies

Any app using your library must provide the usage description string. There's no way around this. That's because malicious frameworks could otherwise provide a usage description and get access to calendar information without the app using the framework ever knowing. Note that on more recent versions of the OS the usage description string names have changed: TN3152: Migrating to the latest Calendar access levels | Apple Developer Documentation