How to add a sandboxed app to the login items

前端 未结 3 1969
故里飘歌
故里飘歌 2021-02-01 05:31

I want my app to auto start if the user select the option. The methods I have been using is not allowed anymore in sandboxed apps.

I know I have to create a helper to a

3条回答
  •  情书的邮戳
    2021-02-01 05:54

    You could try using the Service Management Framework

    http://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingLoginItems.html#//apple_ref/doc/uid/10000172i-SW5-SW1

    As referenced from http://developer.apple.com/library/mac/#documentation/Security/Conceptual/AppSandboxDesignGuide/DesigningYourSandbox/DesigningYourSandbox.html ...

    To create a login item for your sandboxed app, use the SMLoginItemSetEnabled function (declared in ServiceManagement/SMLoginItem.h) as described in Adding Login Items Using the Service Management Framework in Daemons and Services Programming Guide.

    (With App Sandbox, you cannot create a login item using functions in the LSSharedFileList.h header file. For example, you cannot use the function LSSharedFileListInsertItemURL. Nor can you manipulate the state of launch services, such as by using the function LSRegisterURL).

提交回复
热议问题