I referred this(https://developer.apple.com/forums/thread/721737?answerId=739716022#739716022) example, this works for agent, but I am not able to Launch a daemon As documentation says "If your app uses launch daemons, it needs to register those first. Launch daemons require authentication by the user", how do I get user authorizes the LaunchDaemon. In Smjobbless we used AuthorizationRef, but how do i use it with SMAppservice?
SMAppService
can install a daemon; start with daemon(plistName:)
method.
how do I get user authorizes the LaunchDaemon
When you call SMAppService.register()
, the system will request that the user authorise the installation of your daemon.
The one thing to watch out for here is sandboxing. If your app is sandboxed, your daemon must be sandboxed also.
This typically isn’t a problem because most folks interested in daemons are working outside of the Mac App Store, and thus can freely turn off the App Sandbox. However, if you’ve decided that you want to sandbox your main app then it is possible to set up your daemon to be sandboxed. Lemme know if that’s the case here and I can help you set that up.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"