How to launch Finer Sync Extension on launching the main app?

In my Cocoa application, I have a finder sync extension.

On launching the application, my finder sync extension doesn't start automatically.

I need to go to System Preferences -> Extensions and enable it.

How do i make sure that on launch of my main application (.app) file the finder sync extension is launched and is enabled?

Replies

When your App is outside (disabled) Sandbox you can use:


Objective C:

system("pluginkit -e use -i <yourFinderExtensionBundleID>");


or Swift:


let pipe = Pipe()

let task = Process()

task.launchPath = "/usr/bin/pluginkit"

task.arguments = ["-e", "use", "-i", "<yourFinderExtensionBundleID>"]

task.standardOutput = pipe

let file = pipe.fileHandleForReading

task.launch()


let result = NSString(data: file.readDataToEndOfFile(), encoding:

ploenne_, could you help me?

Is there any ways to activate finder sync extension when application is inside sandbox? Sometimes my finder sync extension launches with main app. But sometimes finder sync extension process is missing in system processes.