I want to use Finder Sync Extensions exactly like Dropbox like add toolbar icon and update the badge icons while syncing using Objective C in Xcode.
I searched in google a lot but I could not found any sample code related to this.
I found only one link for that Finder Sync.
But i want to know the sample procedure to integrate Finder Sync Extension as an example or code for more understanding.
Thanks in adv..!!
I am the author of Seafile's Finder Sync Extension code. Thanks for post the link to my code. I have improved the code overtime since the first publish.
The architecture is much simpler than what's the windows' explorer extension programming. Firstly you need to tell Finder (or
FIFinderSyncController
) which directories you want to watch (via settingdirectoryURLs
), and theFIFinderSyncController
will callback viabeginObservingDirectoryAtURL
when the user visits some directory in Finder. Then if the specific files in the directory are visited the first time afterrequestBadgeIdentifierForURL
call, you will be called back withrequestBadgeIdentifierForURL
. You should record this information if you want to update the badge later. Finally you can set badge on your files whenever possible in the main queue viasetBadgeIdentifier
.Another important thing to mention is, as the official document says, that the Extension is running in another process (neither the threads from Finder nor those from your apps) and talking with Finder via XPC. And you might need to interact with your extension via some kind of IPC such as XPC or mach ports since the extension is required to be sandboxed.
I hope this information will help you with your code.