DeviceCheck for Apple Attest

Hi,

Using the https://developer.apple.com/documentation/devicecheck
I should be able to leverage the attest APIs to verify the integrity of my apps. However, I am constantly getting an unknownSystemFailure when attempting to attestKey(_:).

This is after key pair generation and clientDataHash for the challenge. Please refer to the code sample. Would appreciate any feedback on how to get this to work.

Code Block swift
let service = DCAppAttestService.shared     
guard service.isSupported else { 
          return     
}               
service.generateKey { (keyId, error) in           
if error != nil {               
print("\(error!.localizedDescription)")               
return           
}                       
print(keyId!)           
let challenge = "r6ctg89rt3948tc497tn4379".data(using: .utf8)           
let hash = Data(SHA256.hash(data: challenge!))           
service.attestKey(keyId!, clientDataHash: hash) { (attestationObject, error) in               
if error != nil {                   
print("\(error!.localizedDescription)")                   
return               
}               
print(attestationObject?.debugDescription)           
}       
}

Accepted Reply

Currently the documentation has an important callout about this error:
Calling the attestKey(_:clientDataHash:completionHandler:) method returns the unknownSystemFailure error. For more information, see iOS & iPadOS 14 Beta 2 Release Notes.
https://developer.apple.com/documentation/ios-ipados-release-notes/ios-ipados-14-beta-release-notes

Replies

It looks like the API may be trying to connect to development.appattest.apple.com, but DNS lookups fail.
Currently the documentation has an important callout about this error:
Calling the attestKey(_:clientDataHash:completionHandler:) method returns the unknownSystemFailure error. For more information, see iOS & iPadOS 14 Beta 2 Release Notes.
https://developer.apple.com/documentation/ios-ipados-release-notes/ios-ipados-14-beta-release-notes