Trying to resolve NSNetService in Siri Intent extension and nothing happens and Siri just times out after some time.

I'm trying to resolve NSNetService address in the Siri extension, but nothing happens - resolveWithTimeout is called, but after a while Siri just times out. Same code works in the main app..


To see what happens I have set timeout to 1 sec - and it still doesn't time out, it just does nothing.

OK, after some time - it seems that it does work, but resolving takes a LOT of time (~2 min) while in app is almost instant.

How are you scheduling the

NSNetService
delegate callback? I suspect what’s happening here is that the service is scheduled on a run loop that’s not run very often, and hence the huge delay.

The other possibility is that your app extension is being suspended; you can rule out that possibility by using

-[NSProcessInfo performExpiringActivityWithReason:usingBlock:]
to temporarily prevent suspension.

Oh, and finally, why are you resolving this service? I generally try to avoid doing that, but instead use a connect-to-service API where possible.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
Trying to resolve NSNetService in Siri Intent extension and nothing happens and Siri just times out after some time.
 
 
Q