Skip to main content

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
Returns: Attestation token to verify on 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 to app.json:
Enable Play Integrity API in Google Cloud Console.

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

  1. Server Verification: Always verify attestation tokens on your server
  2. Fresh Challenges: Use unique, time-limited challenges
  3. Graceful Degradation: Handle unavailable integrity checks gracefully
  4. Rate Limiting: Limit attestation requests to prevent abuse
  5. Secure Storage: Store attestation keys securely
  6. Error Handling: Handle errors without revealing security details
Never rely solely on client-side integrity checks. Always verify attestation tokens on your secure server.

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.

Resources