Using XPC on iOS

Hi,
I am trying to establish XPC connection on iOS in order to be able to share MTLSharedTextureHandle between two apps.
I understand that I would need to use anonynous service with XPC listener, and I am able to get its NSXPCConnectionEndpoint.
The question is how do I send the endpoint object to the other side? While NSXPCConnectionEndpoint seems to implement NSSecureCoding, it seems it would only accept NSXPCCoder and would NOT accept another type of coder like NSKeyedArchiver (e.g. to share the endpoint over persistent storage).
It seems to be the chicken and the egg problem, where I would need an existing XPC connection to pass NSXPCConnectionEndpoint object to the other side. But the only way to establish XPC connection is to use NSXPCConnectionEndpoint.
Any ideas who to make this work on iOS?

Thank you,
Leo

I am trying to establish XPC connection on iOS in order to be able to share MTLSharedTextureHandle between two apps.

That’s not possible. iOS supports XPC in very limited scenarios (right now, that means “an app talking to a file provider”) and this does not include communication between arbitrary apps.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
Thanks.
Is there a method available on iOS to share MTLSharedTextureHandle between an extension and the main app (instead of just two arbitrary apps)?

Probably not but, just to be sure, what sort of app extension are you working on?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
It's a Broadcast Extension that uses ReplayKit 2 to capture screen frames.

I don’t think that broadcast extensions offer any additional XPC features but it’s not really my area of expertise. I recommend that you start a new thread with the focus being on ReplayKit (and with the ReplayKit tag).

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
Using XPC on iOS
 
 
Q