iOS version : 15.4.1
xcode : 13.3.1
my code:
let threadClient = THClient()
threadClient.retrieveAllCredentials { credentials, error in
if let credentials = credentials {
print(" count = \(credentials.count)")
credentials.forEach { credential in
print(" networkKey = \(String(describing: credential.networkKey))")
print(" extendedPANID = \(String(describing: credential.extendedPANID))")
print(" borderAgentID = \(String(describing: credential.borderAgentID))")
print(" activeOperationalDataSet = \(String(describing: credential.activeOperationalDataSet))")
print(" networkKey = \(String(describing: credential.networkKey))")
print(" pskc = \(String(describing: credential.pskc))")
print(" channel = \(credential.channel)")
print(" panID = \(String(describing: credential.panID))")
print(" creationDate = \(String(describing: credential.creationDate))")
print(" lastModificationDate = \(String(describing: credential.lastModificationDate))")
}
}
}
result:
2022-05-09 18:04:29.864501+0900 [36766:2122724] Client: -[THClient connectToXPCService] - connectToXPCService Connection resumed
2022-05-09 18:04:29.867340+0900 [36766:2124576] Successfully established connection
2022-05-09 18:04:29.867367+0900 [36766:2124545] CTCS XPC Client - isConnected: true
2022-05-09 18:04:29.867434+0900 [36766:2124576] clientProxyWithErrorHandler connected=YES
2022-05-09 18:04:29.867540+0900 [36766:2124576] Client: -[THClient getConnectionEntitlementValidity]_block_invoke_2 - Error: (null)
2022-05-09 18:04:29.867628+0900 [36766:2122724] Client: -[THClient init] - XPC Client Init done
2022-05-09 18:04:29.867709+0900 [36766:2122724] Client: -[THClient retrieveAllCredentials:]:554 - Calling Server remoteObjectProxyWithErrorHandler
2022-05-09 18:04:29.867827+0900 [36766:2122724] -[THClient dealloc] : Client: - deallocated...
2022-05-09 18:04:29.867993+0900 [36766:2124576] Client: -[THClient retrieveAllCredentials:]_block_invoke - Error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service with pid 36689 named com.apple.ThreadNetwork.xpc was invalidated from this process." UserInfo={NSDebugDescription=The connection to service with pid 36689 named com.apple.ThreadNetwork.xpc was invalidated from this process.}
The results are the same with retrievePreferredCredentials
2022-05-09 17:51:44.152819+0900 [36628:2119289] CTCS XPC Client - isConnected: true
2022-05-09 17:51:44.152987+0900 [36628:2118644] clientProxyWithErrorHandler connected=YES
2022-05-09 17:51:44.153174+0900 [36628:2118644] Client: -[THClient getConnectionEntitlementValidity]_block_invoke_2 - Error: (null)
2022-05-09 17:51:44.153328+0900 [36628:2114499] Client: -[THClient init] - XPC Client Init done
2022-05-09 17:51:44.153475+0900 [36628:2114499] Client: -[THClient retrievePreferredCredentials:]:636 - Calling Server remoteObjectProxyWithErrorHandler
2022-05-09 17:51:44.153660+0900 [36628:2114499] Client: -[THClient retrieveAllCredentials:]:554 - Calling Server remoteObjectProxyWithErrorHandler
2022-05-09 17:51:44.153821+0900 [36628:2114499] -[THClient dealloc] : Client: - deallocated...
2022-05-09 17:51:44.154 [com.apple.main-thread:2114499] I EasySetupSelectLocationRoomWireFrame(89):setInterface(presenter:resourceModel:device:) - setInterface()
2022-05-09 17:51:44.154977+0900 [36628:2119289] Client: -[THClient retrieveAllCredentials:]_block_invoke - Error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service with pid 36689 named com.apple.ThreadNetwork.xpc was invalidated from this process." UserInfo={NSDebugDescription=The connection to service with pid 36689 named com.apple.ThreadNetwork.xpc was invalidated from this process.}
2022-05-09 17:51:44.155242+0900 [36628:2119289] Client: -[THClient retrievePreferredCredentials:]_block_invoke - Error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service with pid 36689 named com.apple.ThreadNetwork.xpc was invalidated from this process." UserInfo={NSDebugDescription=The connection to service with pid 36689 named com.apple.ThreadNetwork.xpc was invalidated from this process.}
of course entitlement Additional Capabilities are added.
What does the error means?
Is there any I am missing?
DNS-SD monitoring status :
Lookup MyHome8._meshcop._udp.local
DATE: ---Mon 09 May 2022---
13:49:49.712 ...STARTING...
15:05:07.265 MyHome8._meshcop._udp.local. can be reached at 20F.local.:49191 (interface 13)
rv=1 nn=MyHome8 xp=42?˟uJ? tv=1.2.0 vn=Apple\ Inc. xa=?\(s?\(?.? sb=\\\x00\\\x00\\\x001