Connecting a sandboxed app extension to an XPC service outside of the sandbox

I have a Safari App extension that has to communicate with another app that is outside the sandbox. I wanted to place an XPC service in between the two.
  1. Would it be possible to talk to an XPC service outside the sandbox with the use of temporary entitlements ? or are apple events the only way to go?

  2. If XPC service is possible, would it have to be an XPC exposed through a daemon process or can it be bundled with the non sandboxed app ?

I'm struggling with the very same issue and I think this SHOULD be possible, because many MacOS APIs you use (e.g. Notification-Center notification requests) are dealt out to the notification-center daemon via XPC, so obviously it happens.

In my case, my external "another" app outside the sandbox is publishing an XPC service in the user's domain, and my calls to establish the connection finally fail because

default	15:21:24.427058 [0x14a846f00] activating connection: mach=true listener=false peer=false name=com.mycompany.myapp.browser.monitor
default	15:21:24.427459 [0x14a846f00] failed to do a bootstrap look-up: xpc_error=[159: Unknown error: 159]

Have you been able to overcome this obstacle?

Connecting a sandboxed app extension to an XPC service outside of the sandbox
 
 
Q