Firebase AI App Check: Real-time Live API requests showing as Unverified while standard Generative AI requests are Verified
I am using the Firebase AI Logic SDK in my Android application (Kotlin/Compose Multiplatform). I have implemented Firebase App Check using the Play Integrity provider. In the Firebase Console, I can see that requests from my features using standard generative models (like Vision and text generation) are correctly appearing as Verified Requests. However, the requests made via the Live API (Realtime Chat) with audio streaming consistently appear as Unverified Requests.
I am using the googleAI() backend and have enabled useLimitedUseAppCheckTokens as recommended in the documentation to prepare for replay protection.
I initialize the FirebaseAI instance in my AppContainer:
val firebaseAi: FirebaseAI by lazy {
Firebase.ai(
backend = GenerativeBackend.googleAI(),
useLimitedUseAppCheckTokens = true
)
}
Implementation of the Real-time Service: The real-time session is established using the liveModel:
// Inside RealtimeChatService
val liveModel = firebaseAi.liveModel(
modelName = "gemini-2.5-flash-native-audio-preview-12-2025",
generationConfig = liveGenerationConfig {
responseModality = ResponseModality.AUDIO
}
)
suspend fun startChat() {
try {
val session = liveModel.connect()
// ... audio streaming logic
} catch (e: Exception) {
Log.e("RealtimeChat", "Connection failed", e)
}
}
The Problem: Even though both the standard AI calls and the Real-time AI calls originate from the same initialized FirebaseAI object within the same app session:
Is there a specific setting in Google Cloud Console or Firebase required specifically for the WebSocket-based connections used by the Live API to respect App Check tokens? Why would the same FirebaseAI instance provide valid tokens for standard REST-like requests but fail for the real-time stream?