Hi.
I'm trying to connect to my ES System Extension from it's App using XPC.
The App code:
The Extension code:
where TeamID and ExtensionBundleId are substituted with real values.
The listener's delegate in Extension conforms to NSXPCListenerDelegate.
Problem: the Extension's callback
is never executed.
Also tried with setting NSEndpointSecurityMachServiceName in Extension's plist to custom name, without success.
What am I doing wrong?
Thanks.
I'm trying to connect to my ES System Extension from it's App using XPC.
The App code:
Code Block _connection = [[NSXPCConnection alloc] initWithMachServiceName:@“TeamID.ExtensionBundleId.xpc” options:NSXPCConnectionPrivileged]; [_connection resume];
The Extension code:
Code Block _connectionListener = [[NSXPCListener alloc] initWithMachServiceName:@“TeamID.ExtensionBundleId.xpc”]; _connectionListener.delegate = self; [_connectionListener resume];
where TeamID and ExtensionBundleId are substituted with real values.
The listener's delegate in Extension conforms to NSXPCListenerDelegate.
Problem: the Extension's callback
Code Block - (BOOL)listener:(NSXPCListener *)listener shouldAcceptNewConnection:(NSXPCConnection *)newConnection
is never executed.
Also tried with setting NSEndpointSecurityMachServiceName in Extension's plist to custom name, without success.
What am I doing wrong?
Thanks.
Don't know what I did exactly, but now it works, either with standard Mach service, or with custom...
Added App Groups entitlement to the App and Extension, also to Provisioning Profile (in spite of the App is not Sandboxed),
Changed certificate from Apple Development to Developer ID,
Added exported object from the Extension side and called it's method from the App side.
Solved.
Added App Groups entitlement to the App and Extension, also to Provisioning Profile (in spite of the App is not Sandboxed),
Changed certificate from Apple Development to Developer ID,
Added exported object from the Extension side and called it's method from the App side.
Solved.