title: How should Finder Sync Extension and Main App communicate?
body: <p>My use case: I have a 'MainApp' which does the syncing of files.
  I would like that 'MainApp' handles all server calls regarding syncing and other REST API calls such as document-sharing, etc.</p>
  
  <p>On the other hand, I would have a Finder Sync Extension which would show sync-status icon overlays.
  It would also have a file-context-menu-item 'Share' which would present a Share dialog where users can choose with whom to share the file.</p>
  
  <p>Questions:</p>
  
  <ol>
  <li><p>How should FinderSyncExtension and MainApp communicate? Should XCP be utilised and if so, is it ok that communication is two-ways? For example MainApp informing Finder it should refresh because some files have been synced, and Finder informing MainApp that it should perform 'Share' operation.</p></li>
  <li><p>Who should present 'Share' dialog? When FinderSyncExtension 'Share' menu item is clicked, a Share form should be displayed. Should this be displayed by the finder extension or by the MainApp (assuming FinderExtension informed it that 'Share' item was clicked).</p></li>
  </ol>
  
  <p>If Finder extension should present the form, then FinderExtension should also retrieve data from the server (such as contacts and groups for sharing) and I'm not sure if Finder Extension should perform any network calls towards the server.</p>
  
  <p>Researching the topic, I found several approaches:</p>
  
  <ol>
  <li>FinderSyncExtension and MainApp don't communicate directly. Instead, FinderExtension reads data from database to properly show badges. In this scenario it is unclear how FinderExtension should update when sync is finished or how should it inform MainApp to perform some action.</li>
  <li>XPC communication. I guess FinderExtension could initiate calls to MainApp but is opposite direction expected?</li>
  <li>Is there some kind of NotificationCenter between macOS processes? I tried with <code>NSWorkspace.sharedWorkspace.notificationCenter</code> and with <code>NSDistributedNotificationCenter.defaultCenter</code> but they don't seem to deliver notification in MainApp.</li>
  <li>mach_ports as in Seafile project?</li>
  </ol>