Firebase App Check With React Native Applications in 2025
What is Firebase App Check?
Firebase App Check helps secure your backend resources by ensuring that incoming requests come from your authentic, verified app—not from scripts, bots, or tampered versions.
When your app is installed via a trusted source (like Google Play), Firebase generates a time-sensitive, cryptographically signed token. This token can then be passed to your backend to verify the legitimacy of the request.
This is especially critical for mobile apps built with frameworks like React Native, where the application code can be decompiled and inspected—exposing sensitive API endpoints that could otherwise be misused and potentially drive up backend service costs.
How to Implement Firebase App Check
Step 1: Setup Local SHA-256 Key
To enable App Check locally:
1: Generate a Keystore File
Follow Android documentation to create a keystore file.
2: Extract SHA-256 Fingerprint
Navigate to your Android project directory and run
Look for the SHA-256 value under the release/debug signing config.
3: Register SHA-256 for Firebase App Check
- Go to Firebase Console → Select Your Project
- Navigate to Build → App Check
- Under Apps, choose your Android app
- Click “Manage Debug Tokens” or “Add Debug Provider” depending on your UI
- Enter a recognizable name (e.g., Local Debug Device) and paste your SHA-256 key
- Click Register to save the token.
Step 2: Install Required Dependencies
Ensure your google-services.json file is placed in:
Step 3: Get App Check Token on the Client
Create a utility function in your app to retrieve the App Check token:
Backend Configuration
Step 4: Secure Your Server with Firebase Admin SDK
1: Generate Service Account Key
- Go to Firebase Console → Project Settings → Service Accounts
- Click Generate New Private Key and download the file
2: Store the Key Securely
- Keep the file confidential — never expose it publicly, especially in version control (e.g., GitHub)
- Extract the following values and store them safely in your .env file:
- Install Firebase Admin
- Initialize Firebase Admin in Your Backend
Step 5: Verify Token Middleware
Create a middleware to verify the App Check token:
Use it on protected routes like:
Production Notes (Google Play Store)
For production builds:
- Visit Google Play Console → Your App → App Integrity.
- Scroll to the App Signing section.
- Click Settings → Copy the SHA-256 certificate.
- Replace your debug/local key with this one in Firebase Console.
This ensures App Check validation works with production-signed APKs.
Firebase App Check adds a robust security layer for backend resources by validating requests with device-level attestation. When combined with best practices in API design and secure key management, it significantly reduces the risk of abuse, fraud, and unauthorized data access.