Following the documentation, we are struggling to make it work with Firebase App Check using a Debug Token for App Check. Currently this is what we ended up upon following the docs.
build.gradle (submodule)
defaultConfig {
testInstrumentationRunnerArguments["firebaseAppCheckDebugSecret"] = "DEBUG_TOKEN" }
api 'com.google.firebase:firebase-appcheck-playintegrity:17.0.1'
api 'com.google.firebase:firebase-appcheck-debug:17.0.1'
api 'com.google.firebase:firebase-appcheck-ktx:17.0.1'
api 'com.google.android.play:integrity:1.2.0'
api 'com.google.firebase:firebase-appcheck-debug-testing:17.0.1'
Application class
FirebaseApp.initializeApp(this)
debugAppCheckTestHelper.withDebugProvider {
// Test code that requires a debug AppCheckToken.
}
Firebase.analytics.setAnalyticsCollectionEnabled(BuildConfig.DEBUG.not())
Firebase.crashlytics.setCrashlyticsCollectionEnabled(BuildConfig.DEBUG.not())
Firebase.appCheck.installAppCheckProviderFactory(
if (BuildConfig.DEBUG)
DebugAppCheckProviderFactory.getInstance()
else
PlayIntegrityAppCheckProviderFactory.getInstance()
)
We are stuck and do not know how to utilize the debug testing, what we understand is we can provide a Debug Provider Factory using the generated debug token in Firebase Console App Check but it seems that is not how it works.
What we wanted to do is run the app on emulator or physical device manually then later via CI CD with Firebase Test Lab before hitting the production stage and publish it in Play Store.