I have a swiftUI app that displays rich link information. Am using LinkPresentation's startFetchingMetadata(for :url) to get back metadata.
The code below works
DispatchQueue.global(qos: .background).async {
self.metadataProvider.startFetchingMetadata(for: url) { (metadata, error) in
if let error {
print("Error retrieving metadata:", error)
self.metadataProvider.cancel()
completion(false)
return
}
guard let metadata else {
print("Fetched metadata is nil?")
self.metadataProvider.cancel()
completion(false)
return
}
DispatchQueue.main.async {
self.metadata = metadata
self.extractLinkMetadataImage()
self.saveLinkMetadata()
completion(true)
}
}
}
.. but displays the following messages in the Xcode console.
Q1.) How do I remove the assertions error? I've already set Outgoing Network Connections in my App Group to Yes
Q2.) How do I address the purple main thread warning. I've made sure both the startFetchingMetadata and imageProvider.loadObject calls are being made in DispatchQueue.global(qos: .background).async blocks.
2022-12-28 17:51:11.924604-0800 lrn[40432:8224366] [assertion] Error acquiring assertion: <Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}>
2022-12-28 17:51:11.924760-0800 lrn[40432:8224366] [ProcessSuspension] 0x12201c120 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'WebProcess Background Assertion' for process with PID=40438, error: Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}
2022-12-28 17:51:12.170643-0800 lrn[40432:8223670] [Security] This method should not be called on the main thread as it may lead to UI unresponsiveness.
2022-12-28 17:51:12.170826-0800 lrn[40432:8223670] [Security] This method should not be called on the main thread as it may lead to UI unresponsiveness.
2022-12-28 17:51:12.336358-0800 lrn[40432:8224255] [assertion] Error acquiring assertion: <Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}>
2022-12-28 17:51:12.336405-0800 lrn[40432:8224255] [ProcessSuspension] 0x12201c120 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'ConnectionTerminationWatchdog' for process with PID=40440, error: Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}
2022-12-28 17:51:12.336495-0800 lrn[40432:8223670] [ProcessSuspension] ProcessAssertion::remainingRunTimeInSeconds failed to get handle for process with PID=40440
Thanks