iOS 18 Live Caller ID Lookup/PIRService is too unreliable and flaky

I've been following the instructions on how to set up Live Caller ID Lookup using the example PIRService.

And I have been successful - I'm managed to get name information and images retrieved and displayed on the call screen, in addition to being able to block numbers via PIRService too.

So while I did get it working, it was, and still is, incredibly painful to do so due to the fact it only works about 1% of the time.

There's two main problems, which look like they're different manifestations of the same issue. The first problem is difficulty enabling the Live CallerID lookup feature via the flip switch in the iPhone's settings, and then the second issue is when this has been enabled, then a phone number's details is being attempted to be retrieved.

There's a lot, a very lot, of timeout issues being reported by CallKit logging i.e.:

configure failed Error Domain=com.apple.CipherML Code=1100 "Unable to query status due to errors: The request timed out." UserInfo={NSLocalizedDescription=Unable to query status due to errors: The request timed out., NSUnderlyingError=0xd98344450 {Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo={NSLocalizedDescription=The request timed out., NSErrorFailingURLKey=http://192.168.1.100:8080/issue}}}

When this occurs I can see that the request is getting through to the PIRService as it outputs logging to the Mac console:

2024-07-28T09:33:15-0700 info Hummingbird : [HummingbirdCore] Server started and listening on 0.0.0.0:8080
2024-07-28T09:33:37-0700 info Hummingbird : hb_id=5e0330c893af6a98c20e5100fdb26871 hb_method=GET hb_uri=/.well-known/private-token-issuer-directory [Hummingbird] Request
2024-07-28T09:33:37-0700 info Hummingbird : hb_id=5e0330c893af6a98c20e5100fdb26872 hb_method=GET hb_uri=/token-key-for-user-token [Hummingbird] Request

So it would appear that requests are getting through to PIRService but then something is timing out after that. Could that be the PrivacyPass/Homomorphic Encryption stuff? Or something else?

What could be a cause of this instability, and is there anything that can be done to increase reliability of it?

(Xcode 16 beta 4, iOS 18 developer beta 4, Sonoma 14.5, the iPhone(s) being tested are connected to the Mac via usb cable, running on the same Wifi network).

Here are a couple of more issue that appear:

<private> XPC request complete, status(0) error:Error Domain=CipherML.CipherMLError Code=5 "server error ({"error":{"message":"No token key found with key id: [186, 183, 73, 109, 88, 42, 99, 19, 116, 183, 189, 131, 111, 95, 249, 54, 122, 9, 44, 65, 69, 234, 109, 2, 214, 146, 210, 97, 207, 93, 139, 80]"}})" UserInfo={NSLocalizedDescription=server error ({"error":{"message":"No token key found with key id: [186, 183, 73, 109, 88, 42, 99, 19, 116, 183, 189, 131, 111, 95, 249, 54, 122, 9, 44, 65, 69, 234, 109, 2, 214, 146, 210, 97, 207, 93, 139, 80]"}})}

error = Error Domain=com.apple.CipherML Code=400 "Error Domain=com.apple.CipherML Code=401 "Unable to request data by keywords batch: missing configuration" UserInfo={NSLocalizedDescription=Unable to request data by keywords batch: missing configuration, NSUnderlyingError=0xd623415c0 {Error Domain=CipherML.CipherMLError Code=25 "missing configuration" UserInfo={NSLocalizedDescription=missing configuration}}}: missing configuration" UserInfo={NSLocalizedDescription=Error Domain=com.apple.CipherML Code=401 "Unable to request data by keywords batch: missing configuration" UserInfo={NSLocalizedDescription=Unable to request data by keywords batch: missing configuration, NSUnderlyingError=0xd623415c0 {Error Domain=CipherML.CipherMLError Code=25 "missing configuration" UserInfo={NSLocalizedDescription=missing configuration}}}: missing configuration, NSUnderlyingError=0xd623415c0 {Error Domain=CipherML.CipherMLError Code=25 "missing configuration" UserInfo={NSLocalizedDescription=missing configuration}}}

I'm not sure about the timeout issue generally speaking. Are you running in the release build, or debug build? You might see performance improvements by running the release build.

For the No token key found with key id error, this should be covered by this doc: https://swiftpackageindex.com/apple/live-caller-id-lookup-example/main/documentation/pirservice/commonerrors#No-token-key-found-with-key-id

For the missing configuration error: the device issued a request to the configuration endpoint (/config), but did not find the configuration for the usecase it was looking for. Double-check that the service has usecases configured the way the device expects them. Usecase names should be:

  • <bundleIdentifier>.block
  • <bundleIdentifier>.identity

where <bundleIdentifier> is replaced with bundle identifier of your Live Caller ID Lookup extension.

iOS 18 Live Caller ID Lookup/PIRService is too unreliable and flaky
 
 
Q