Skip to content

[🐛] App Check token generated successfully but requests are not marked as verified by Firebase #8484

@tiagoheliob

Description

@tiagoheliob

Issue

We are using @react-native-firebase/app-check in an Expo-managed React Native app. In development mode, we are initializing App Check with a debugToken for iOS. The token is successfully generated using appCheck().getToken() and is printed to the console.

However, Firebase does not mark any requests as verified in the App Check dashboard. Even though the token looks valid and is generated correctly, we don't see any verification on the backend:

  • The App Check dashboard shows 0 verified requests.
  • No network request is made to firebaseappcheck.googleapis.com during token generation.
  • No errors are thrown.
  • We haven't confirmed whether the token is attached to outgoing requests (e.g. in Authorization headers).

This makes it unclear whether App Check is actually working during development with debug tokens.

Code

  useEffect(() => {
    const isDev = isDevOrStaging();
    const provider = appCheck().newReactNativeFirebaseAppCheckProvider();

    const initAppCheck = async () => {
      const platform = Platform.OS as 'android' | 'ios';
      const env = config.appEnv as 'development' | 'staging';
      const debugToken = isDev ? config.debugToken[platform][env] : undefined;

      try {
        provider.configure({
          apple: {
            provider: isDev ? 'debug' : 'deviceCheck',
            debugToken,
          },
          android: {
            provider: isDev ? 'debug' : 'playIntegrity',
            debugToken,
          },
        });

        await appCheck().initializeAppCheck({
          provider,
          isTokenAutoRefreshEnabled: true,
        });
        const token = await appCheck().getToken();
        console.log('token', token);
      } catch (error) {
        console.error('error', error);
      }
    };

    initAppCheck();
  }, []);

Project Files

Javascript

Click To Expand

package.json:

# N/A

firebase.json for react-native-firebase v6:

# N/A

iOS

Click To Expand

ios/Podfile:

  • I'm not using Pods
  • I'm using Pods and my Podfile looks like:
# N/A

AppDelegate.m:

// N/A


Android

Click To Expand

Have you converted to AndroidX?

  • my application is an AndroidX application?
  • I am using android/gradle.settings jetifier=true for Android compatibility?
  • I am using the NPM package jetifier for react-native compatibility?

android/build.gradle:

// N/A

android/app/build.gradle:

// N/A

android/settings.gradle:

// N/A

MainApplication.java:

// N/A

AndroidManifest.xml:

<!-- N/A -->


Environment

Click To Expand

react-native info output:

 OUTPUT GOES HERE
  • Platform that you're experiencing the issue on:
    • iOS
    • Android
    • iOS but have not tested behavior on Android
    • Android but have not tested behavior on iOS
    • Both
  • react-native-firebase version you're using that has this issue:
    • e.g. 5.4.3
  • Firebase module(s) you're using that has the issue:
    • e.g. Instance ID
  • Are you using TypeScript?
    • Y/N & VERSION


Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions