Created
Jul ’21
Replies
4
Boosts
0
Views
1.3k
Participants
3
The standard approach is to have your Endpoint Security system extension publish an XPC service and then have the client app communicate with that service over XPC. If your system extension is written in C then you can either:
Use the low-level XPC API directly. See the xpc man page for details.
Create a separate Objective-C (or Swift) subsystem to handle the XPC and then use the higher-level NSXPCConnection API.
Either way, you must set the NSEndpointSecurityMachServiceName property in your Info.plist so that the system let’s it publish the XPC service. See the EndpointSecurity man page for the details.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
Thanks eskimo. Do you have any template which does the same ?
Also what do you mean by subsystem
You said that your ES sysex is written entirely in C. C code cannot use NSXPCConnection directly — that API is only usable from Objective-C [1] [2] — so you’d have to:
Write the NSXPCConnection in Objective-C.
Have that export its functionality via a C interface so that the rest of your ES sysex can use it.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] And Swift, but only through Swift’s Objective-C compatibility features.
[2] Oh, and technically you can interact with any Objective-C API from C using the Objective-C runtime, but that’s so not fun.
Here is the sample code.
I’m sorry but the formatting on your comment makes it effectively unreadable. I think it’d be better for you to start a new thread with you specific details. Feel free to reference this thread in your post.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"