2021 Privacy & Security
WWDC21 · 19 min · Privacy & Security
Mitigate fraud with App Attest and DeviceCheck
Discover how to use App Attest and DeviceCheck, Apple’s powerful anti-fraud tools, created to safeguard your apps and content. Unlock the secrets of deploying App Attest by incorporating it into your app to block unauthorized modifications of your app and content. We’ll also show you how to use DeviceCheck to ensure you can distinguish between customers who have received premium content in your app, and those who have attained it through illegitimate means.
Watch at developer.apple.com ↗Code shown on screen · 3 snippets
Create an App Attest key
let appAttestService = DCAppAttestService.shared
if appAttestService.isSupported {
appAttestService.generateKey { keyId, error in
guard error == nil else { /* Handle the error. */ }
// Cache keyId for subsequent operations.
}
} else {
// Handle fallback as untrusted device
} Generate key attestation
appAttestService.attestKey(keyId, clientDataHash: clientDataHash) { attestationObject, error in
guard error == nil else { /* Handle error. */ }
// Send the attestation object to your server for verification.
} Generate assertion
appAttestService.generateAssertion(keyId, clientDataHash: clientDataHash) { assertionObject, error in
guard error == nil else { /* Handle error. */ }
// Send assertion object with your data to your server for verification
} Resources
Related sessions
-
12 min