Search code examples
objective-ccocoaosx-yosemitefindersync

How to enable FinderSync Extension in macOS System Preferences


I am integrating FinderSync Extension in my Cocoa Application to show badges in files and folders. Look at the below two scenario:

  1. When i run application using FinderSync Extension (like DemoFinderSync) look at the blue popup in the below image, in that case Extension is added in the System Preference with Check mark and called that principal class "FinderSync.m" as well.

Screen shot 1

  1. When i run application using my Application Scheme (like DemoApp) look at the blue popup in the below image, in that case Extension is added in the System Preference but without check mark and that principal class "FinderSync.m" do not call and FinderSync Extension does not work in this case.

Screen Shot 2

Does anybody have an idea how to enable Finder Extension in the System Preference using second scenario?


Solution

  • I got the solution:

    Code to Enable Extension (bundle ID)

    system("pluginkit -e use -i YourAppBundleID")
    

    Code to Disable Extension (bundle ID)

    system("pluginkit -e ignore -i YourAppBundleID")
    

    Before i used:

    system("pluginkit -e use -i AppBundleID.FinderSync")
    

    so just remove ".FinderSync" its working.