I want to add some configuration that I have:
The extension is created the listener:
let newListener = NSXPCListener(machServiceName: machServiceName)
newListener.delegate = self
newListener.resume()
and the app is registered:
let newConnection = NSXPCConnection(machServiceName: machServiceName, options: [])
// The exported object is the delegate.
newConnection.exportedInterface = NSXPCInterface(with: AppCommunication.self)
newConnection.exportedObject = delegate
// The remote object is the provider's IPCConnection instance.
newConnection.remoteObjectInterface = NSXPCInterface(with: ProviderCommunication.self)
currentConnection = newConnection
newConnection.resume()
guard let providerProxy = newConnection.remoteObjectProxyWithErrorHandler({ registerError in
DDLogError("Failed to register with the provider: \(registerError.localizedDescription)")
self.currentConnection?.invalidate()
self.currentConnection = nil
completionHandler(false)
}) as? ProviderCommunication else {
DDLogError("Failed to create a remote object proxy for the provider")
completionHandler(false)
return
}
providerProxy.register(completionHandler)
With the same machServiceName.
Do I need to add com.apple.security.temporary-exception.mach-lookup.global-name and com.apple.security.temporary-exception.mach-register.global-name to the app entitlement file or to the extension entitlement file? If yes, which entitlement need to be in the app and which one in the extension and what should be the value?