[help] How can I use FileHandle as argument of withMessageType
Closed this issue · 3 comments
chaosong commented
I searched the code repository, and didn't find any code to handle this situation. Is there a Codable FileHandle example?
Thanks!
jakaplan commented
This is not currently supported. SecureXPC only supports types which can be (de)serialized, which is what Codable
represents. File handles are inherently live references and therefore can't be serialized.
Note the underlying XPC framework does support sending file handles, but it's not supported by SecureXPC.
jakaplan commented
The 0.5.2 release now supports this via the new XPCFileDescriptorContainer
.
chaosong commented
Bravo! It works. Thank you!