Is it okay to install both app check provider factory? Or should I use only one for debug and other one for release? If yes then how to do it?
Code snippet I'm referring to:
package pl.matematykagryzie.app
import android.os.Bundle
import android.util.Log
import io.flutter.embedding.android.FlutterActivity
import com.google.firebase.FirebaseApp
import com.google.firebase.appcheck.FirebaseAppCheck
import com.google.firebase.appcheck.debug.DebugAppCheckProviderFactory
import com.google.firebase.appcheck.safetynet.SafetyNetAppCheckProviderFactory
import com.google.firebase.functions.FirebaseFunctions
class MainActivity: FlutterActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// Initialize firebae app
FirebaseApp.initializeApp(/*context=*/this)
val firebaseAppCheck = FirebaseAppCheck.getInstance()
firebaseAppCheck.installAppCheckProviderFactory(
DebugAppCheckProviderFactory.getInstance())
// Activate app check
firebaseAppCheck.installAppCheckProviderFactory(
SafetyNetAppCheckProviderFactory.getInstance())
val data = hashMapOf(
"isKotlin" to true
)
// Call a function
FirebaseFunctions
.getInstance("europe-central2")
.getHttpsCallable("validateAppCheck")
.call(data)
.addOnFailureListener {
Log.wtf("onCreate", "failure")
}
.addOnSuccessListener {
Log.wtf("onCreate", "success")
}
}
}
Please note that I'm not kotlin nor android developer.
I'm developing a flutter app and recently added firebase app check which causes a lot of troubles to me and I'm pushing really hard to resolve them.
I'm trying to narrow down the scope of the issue I have.