trevordevore / levure

Application development framework for LiveCode
MIT License
32 stars 14 forks source link

Question: Is it possible to specify Privacy and Security entitlement requirements as part of build? #190

Closed rodneytamblyn closed 1 year ago

rodneytamblyn commented 1 year ago

Hi Trevor,

I have an app that requires Privacy and Security permission (OSX) to access Calendar. There's no way to manually add an app to the Calendar security pane. Is there a way to specify permission requirements (Full Disk access, Calendar) etc as part of build process, e.g. via plist? Or if you have any other tips or suggestions on this topic would be most interested. In my case Livecode is not prompting for Calendar permission (although it does for Automation privilege), and thereafter script is failing. However other users report it does add for them (https://forums.livecode.com/viewtopic.php?f=8&t=37401)

Rod

rodneytamblyn commented 1 year ago

I think I need to add entitlement, testing:

    <key>com.apple.security.personal-information.calendars</key>
    <true/>

https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_personal-information_calendars

rodneytamblyn commented 1 year ago

This was the solution :-)

trevordevore commented 1 year ago

I'm glad you found the solution @rodneytamblyn. For anyone else who comes across this, an entitlement is just a file that you will include in your build. In the Levure app.yml file you would have an entry similar to the following that would add the entitlements to your resources folder.

build profiles:
  all profiles:
    copy files:
      macos resources:
        - filename: ../build files/Entitlements/MyApp.entitlements

In the code I have in my project I've named the file the same name as my app name in the Info.plist file. ../build files is the folder that sits alongside the Levure app folder and contains files used when packaging the app and building installers. The file ends up in the macOS .app/Contents/Resources folder.

macMikey commented 1 year ago

do you mind if i update the wiki?

trevordevore commented 1 year ago

I would love it if you did @macMikey !

macMikey commented 1 year ago

turns out, it's already here

trevordevore commented 1 year ago

Well that was easy :-)