Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add to Login Item - SandBox-friendly solution

OK, here's my situation :

  • I'm having several apps (Status bar apps, actually), having to start at login (if user wishes so)
  • I've been using Uli Kuster's LoginItem code, which worked flawlessly
  • As per latest Apple guidelines, all newly-submitted apps HAVE TO be sandboxed.

The issue :

  • UKLoginItem and SandBox don't work together. So, I'm looking for an alternative (and acceptable) way to do the very same thing.

Any ideas? Any reference to point me to?

like image 278
Dr.Kameleon Avatar asked Dec 09 '25 03:12

Dr.Kameleon


2 Answers

You can use an helper tool to start the apps at login.

An example is here:

http://blog.timschroeder.net/2012/07/03/the-launch-at-login-sandbox-project/

like image 194
usain Avatar answered Dec 12 '25 00:12

usain


Use the Service Management framework. Specifically, SMLoginItemSetEnabled. See Adding Login Items Using the Service Management Framework.

Note that you must use the Service Management framework. The LaunchServices methods are not available in a sandboxed environment.

like image 42
more tension Avatar answered Dec 11 '25 22:12

more tension