Android app check play Integrity not work

Viewed 741

Previously, I used to check the application through Safety Net. Then, when logging in by phone number, the error This request is missing a valid app identifier came out. I started to figure it out and read that use the app check via Play Integrity. I started trying, the error is the same. Now I can neither turn on Play Integrity, nor turn off all verification methods. The error is the same. I read the forum, did all the settings and recommendations. It didn't help. Tell me plz, maybe there are more ideas or successful practice in this.

Dependencies

implementation 'com.google.firebase:firebase-appcheck-debug:16.0.0'
implementation 'com.google.firebase:firebase-appcheck-playintegrity'

Initialization

if (BuildConfig.DEBUG) {
Timber.plant(Timber.DebugTree())

    FirebaseApp.initializeApp(/*context=*/this)
    val firebaseAppCheck = FirebaseAppCheck.getInstance()
    firebaseAppCheck.installAppCheckProviderFactory(
        DebugAppCheckProviderFactory.getInstance()
    )
} else {

    FirebaseApp.initializeApp(/*context=*/this)
    val firebaseAppCheck = FirebaseAppCheck.getInstance()
    firebaseAppCheck.installAppCheckProviderFactory(
        PlayIntegrityAppCheckProviderFactory.getInstance()
    )
}

All signatures have been added to the FB project (debug, release, store) SHA-1 and SHA-256.

The following APIs are included:

  • Android Device Verification
  • Firebase App Check API
  • Firebase Installations API
  • Google Play Integrity API
  • Identity Toolkit API
  • Token Service API

What else is missing?

3 Answers

Currently API does not send valid tokens and it simply does not work.

SafetyNet will keep working for a year. So temporary solution will be keep using SafetyNet until API get a fix update. Turn off date for SafetyNet is June 30, 2024 based on email Google sent to developers which use SafetyyNet in their apps.

You probably need to setup the Play Integrity API by enabling it in the Play Console (see the details in the official documentation).

Make sure you are using updated versions of Firebase dependencies since some of these dependencies were updated after introducing Firebase App Check. The best way to achieve this is by using the Firebase Android BoM and remove versions from all Firebase dependencies in your app/build.gradle. Another thing to check is that you are including the latest google-services.json installed from Firebase console -> Project Settings -> Android App.

Regarding the use of App Check with the debug provider, make sure to include the debug tokens for all your test/debug devices into Firebase console. Also building on my previous point, remove the ":16.0.0" from the dependency declaration.

Related