expo-app-integrity
Version: 55.0.6 A native module that helps assert app integrity on mobile platforms using Apple’s App Attest and Google’s Play Integrity APIs. Verify that your app hasn’t been tampered with and is running on a genuine device.Installation
Usage
API Reference
Methods
() => Promise<boolean>
Checks if app integrity verification is availableReturns
true on iOS 14+ and Android with Play Services(challenge: string) => Promise<string>
Requests attestation tokenParameters:
challenge(string): Challenge string from your server
Examples
Basic Integrity Check
Protect API Calls
Complete Example with Server Verification
Platform Support
Server-Side Verification
iOS (App Attest)
Android (Play Integrity)
Configuration
iOS
No additional configuration required. App Attest is automatically available on iOS 14+.Android
Add toapp.json:
Use Cases
- Anti-Tampering: Detect if app has been modified or repackaged
- Emulator Detection: Identify if app is running on emulator
- Root/Jailbreak Detection: Detect rooted or jailbroken devices
- API Protection: Verify app integrity before sensitive operations
- License Verification: Ensure app is from official store
- Fraud Prevention: Prevent abuse from modified apps
Best Practices
- Server Verification: Always verify attestation tokens on your server
- Fresh Challenges: Use unique, time-limited challenges
- Graceful Degradation: Handle unavailable integrity checks gracefully
- Rate Limiting: Limit attestation requests to prevent abuse
- Secure Storage: Store attestation keys securely
- Error Handling: Handle errors without revealing security details
Limitations
- iOS: Requires iOS 14 or later
- Android: Requires Google Play Services
- Rate Limits: Both platforms have rate limits on attestation requests
- No Web Support: Not available for web platforms
- Not Foolproof: Can be bypassed by sophisticated attackers
App integrity checks provide an additional layer of security but are not foolproof. Use them as part of a comprehensive security strategy.