I am currently building a sandboxed app that also contains:
- Finder Sync Extension (sandboxed)
- XPC Service (sandboxed)
The XPC Service exists to facilitate communication between the host app and the Finder Sync extension.
So far, I have succesfully established an NSXPCConnection from the host app to the XPC service and was able to invoke a method on the XPC service from the host app. However, when I try to create a similar connection upon instantiation of the principal class of the Finder Sync extension, I immediately receive an error saying that the connection to the service was invalidated. I have confirmed that the XPC service is running, but somehow the connection is still invalidated immediately. I am also using the exact same service name when establishing the connection from the host app and when doing the same thing from the Finder Sync Extension.
- What could be the reason that the NSXPCConnection is invalidated immediately?
- Is there some kind of sandbox restriction at play here?
- Is communicating throught an XPC Service the recommended IPC architecture for a sandboxed app to communicate with an embedded Finder Sync Extension?