Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
359fec8
first commit for appcheck recaptcha support
cynthiajoan May 7, 2026
6c44526
update example
cynthiajoan May 7, 2026
2e59190
Merge branch 'main' into firebaseai/appcheck_research
cynthiajoan May 21, 2026
e9a03b7
Merge branch 'main' into firebaseai/appcheck_research
cynthiajoan May 21, 2026
94e0131
apple tentative implementation
cynthiajoan May 22, 2026
8842bb4
add recaptcha in the plugin swift
cynthiajoan May 27, 2026
57db3e5
minor fix
cynthiajoan May 27, 2026
5a8f598
some dart fix
cynthiajoan May 27, 2026
a2acf79
updated sample app UI
cynthiajoan May 28, 2026
4ab5067
update api name and parameter
cynthiajoan May 29, 2026
c0c443f
Merge branch 'main' into firebaseai/appcheck_research
cynthiajoan May 29, 2026
d1c4187
pigeon update
cynthiajoan May 29, 2026
b8f8b76
setup for web, need https://github.com/firebase/flutterfire/pull/1833…
cynthiajoan Jun 2, 2026
73e3e11
Merge branch 'main' into firebaseai/appcheck_research
cynthiajoan Jun 2, 2026
c0ea605
make the web work with default rCE provider
cynthiajoan Jun 3, 2026
98e3c43
Add recaptcha sitekey from options to native sdk
cynthiajoan Jun 3, 2026
6e7bf9a
add test for option recaptchaSiteKey
cynthiajoan Jun 3, 2026
08bb9c9
address code review
cynthiajoan Jun 3, 2026
fe7e987
update the example UI
cynthiajoan Jun 4, 2026
58d9714
only make the new web provider const
cynthiajoan Jun 4, 2026
ba36a84
Merge branch 'main' into firebaseai/appcheck_research
cynthiajoan Jun 10, 2026
686d6d4
Merge branch 'main' into firebaseai/appcheck_research
cynthiajoan Jun 12, 2026
4d2eee7
some clean up in gradle
cynthiajoan Jun 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ android {
implementation platform("com.google.firebase:firebase-bom:${getRootProjectExtOrCoreProperty("FirebaseSDKVersion", firebaseCoreProject)}")
implementation 'com.google.firebase:firebase-appcheck-debug'
implementation 'com.google.firebase:firebase-appcheck-playintegrity'
implementation 'com.google.firebase:firebase-appcheck-recaptcha'
implementation 'androidx.annotation:annotation:1.7.0'
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import com.google.firebase.FirebaseApp
import com.google.firebase.appcheck.FirebaseAppCheck
import com.google.firebase.appcheck.debug.DebugAppCheckProviderFactory
import com.google.firebase.appcheck.playintegrity.PlayIntegrityAppCheckProviderFactory
import com.google.firebase.appcheck.recaptcha.RecaptchaAppCheckProviderFactory
import io.flutter.embedding.engine.plugins.FlutterPlugin
import io.flutter.embedding.engine.plugins.FlutterPlugin.FlutterPluginBinding
import io.flutter.plugin.common.BinaryMessenger
Expand Down Expand Up @@ -62,6 +63,11 @@ class FirebaseAppCheckPlugin : FlutterFirebasePlugin, FlutterPlugin, FirebaseApp
firebaseAppCheck.installAppCheckProviderFactory(
DebugAppCheckProviderFactory.getInstance())
}
"recaptcha" -> {
firebaseAppCheck.installAppCheckProviderFactory(
RecaptchaAppCheckProviderFactory.getInstance()
)
}
else -> {
firebaseAppCheck.installAppCheckProviderFactory(
PlayIntegrityAppCheckProviderFactory.getInstance())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2025, the Chromium project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Autogenerated from Pigeon (v25.3.2), do not edit directly.
// Autogenerated from Pigeon (v26.3.4), do not edit directly.
// See also: https://pub.dev/packages/pigeon
@file:Suppress("UNCHECKED_CAST", "ArrayInDataClass")

Expand All @@ -10,11 +10,12 @@ package io.flutter.plugins.firebase.appcheck
import android.util.Log
import io.flutter.plugin.common.BasicMessageChannel
import io.flutter.plugin.common.BinaryMessenger
import io.flutter.plugin.common.EventChannel
import io.flutter.plugin.common.MessageCodec
import io.flutter.plugin.common.StandardMethodCodec
import io.flutter.plugin.common.StandardMessageCodec
import java.io.ByteArrayOutputStream
import java.nio.ByteBuffer

private object GeneratedAndroidFirebaseAppCheckPigeonUtils {

fun wrapResult(result: Any?): List<Any?> {
Expand All @@ -23,91 +24,69 @@ private object GeneratedAndroidFirebaseAppCheckPigeonUtils {

fun wrapError(exception: Throwable): List<Any?> {
return if (exception is FlutterError) {
listOf(exception.code, exception.message, exception.details)
listOf(
exception.code,
exception.message,
exception.details
)
} else {
listOf(
exception.javaClass.simpleName,
exception.toString(),
"Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception))
exception.javaClass.simpleName,
exception.toString(),
"Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception)
)
}
}
}

/**
* Error class for passing custom error details to Flutter via a thrown PlatformException.
*
* @property code The error code.
* @property message The error message.
* @property details The error details. Must be a datatype supported by the api codec.
*/
class FlutterError(
val code: String,
override val message: String? = null,
val details: Any? = null
) : Throwable()

class FlutterError (
val code: String,
override val message: String? = null,
val details: Any? = null
) : RuntimeException()
private open class GeneratedAndroidFirebaseAppCheckPigeonCodec : StandardMessageCodec() {
override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? {
return super.readValueOfType(type, buffer)
return super.readValueOfType(type, buffer)
}

override fun writeValue(stream: ByteArrayOutputStream, value: Any?) {
override fun writeValue(stream: ByteArrayOutputStream, value: Any?) {
super.writeValue(stream, value)
}
}


/** Generated interface from Pigeon that represents a handler of messages from Flutter. */
interface FirebaseAppCheckHostApi {
fun activate(
appName: String,
androidProvider: String?,
appleProvider: String?,
debugToken: String?,
callback: (Result<Unit>) -> Unit
)

fun activate(appName: String, androidProvider: String?, appleProvider: String?, debugToken: String?, callback: (Result<Unit>) -> Unit)
fun getToken(appName: String, forceRefresh: Boolean, callback: (Result<String?>) -> Unit)

fun setTokenAutoRefreshEnabled(
appName: String,
isTokenAutoRefreshEnabled: Boolean,
callback: (Result<Unit>) -> Unit
)

fun setTokenAutoRefreshEnabled(appName: String, isTokenAutoRefreshEnabled: Boolean, callback: (Result<Unit>) -> Unit)
fun registerTokenListener(appName: String, callback: (Result<String>) -> Unit)

fun getLimitedUseAppCheckToken(appName: String, callback: (Result<String>) -> Unit)

companion object {
/** The codec used by FirebaseAppCheckHostApi. */
val codec: MessageCodec<Any?> by lazy { GeneratedAndroidFirebaseAppCheckPigeonCodec() }
/**
* Sets up an instance of `FirebaseAppCheckHostApi` to handle messages through the
* `binaryMessenger`.
*/
val codec: MessageCodec<Any?> by lazy {
GeneratedAndroidFirebaseAppCheckPigeonCodec()
}
/** Sets up an instance of `FirebaseAppCheckHostApi` to handle messages through the `binaryMessenger`. */
@JvmOverloads
fun setUp(
binaryMessenger: BinaryMessenger,
api: FirebaseAppCheckHostApi?,
messageChannelSuffix: String = ""
) {
val separatedMessageChannelSuffix =
if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else ""
fun setUp(binaryMessenger: BinaryMessenger, api: FirebaseAppCheckHostApi?, messageChannelSuffix: String = "") {
val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else ""
run {
val channel =
BasicMessageChannel<Any?>(
binaryMessenger,
"dev.flutter.pigeon.firebase_app_check_platform_interface.FirebaseAppCheckHostApi.activate$separatedMessageChannelSuffix",
codec)
val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.firebase_app_check_platform_interface.FirebaseAppCheckHostApi.activate$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List<Any?>
val appNameArg = args[0] as String
val androidProviderArg = args[1] as String?
val appleProviderArg = args[2] as String?
val debugTokenArg = args[3] as String?
api.activate(appNameArg, androidProviderArg, appleProviderArg, debugTokenArg) {
result: Result<Unit> ->
api.activate(appNameArg, androidProviderArg, appleProviderArg, debugTokenArg) { result: Result<Unit> ->
val error = result.exceptionOrNull()
if (error != null) {
reply.reply(GeneratedAndroidFirebaseAppCheckPigeonUtils.wrapError(error))
Expand All @@ -121,11 +100,7 @@ interface FirebaseAppCheckHostApi {
}
}
run {
val channel =
BasicMessageChannel<Any?>(
binaryMessenger,
"dev.flutter.pigeon.firebase_app_check_platform_interface.FirebaseAppCheckHostApi.getToken$separatedMessageChannelSuffix",
codec)
val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.firebase_app_check_platform_interface.FirebaseAppCheckHostApi.getToken$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List<Any?>
Expand All @@ -146,18 +121,13 @@ interface FirebaseAppCheckHostApi {
}
}
run {
val channel =
BasicMessageChannel<Any?>(
binaryMessenger,
"dev.flutter.pigeon.firebase_app_check_platform_interface.FirebaseAppCheckHostApi.setTokenAutoRefreshEnabled$separatedMessageChannelSuffix",
codec)
val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.firebase_app_check_platform_interface.FirebaseAppCheckHostApi.setTokenAutoRefreshEnabled$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List<Any?>
val appNameArg = args[0] as String
val isTokenAutoRefreshEnabledArg = args[1] as Boolean
api.setTokenAutoRefreshEnabled(appNameArg, isTokenAutoRefreshEnabledArg) {
result: Result<Unit> ->
api.setTokenAutoRefreshEnabled(appNameArg, isTokenAutoRefreshEnabledArg) { result: Result<Unit> ->
val error = result.exceptionOrNull()
if (error != null) {
reply.reply(GeneratedAndroidFirebaseAppCheckPigeonUtils.wrapError(error))
Expand All @@ -171,11 +141,7 @@ interface FirebaseAppCheckHostApi {
}
}
run {
val channel =
BasicMessageChannel<Any?>(
binaryMessenger,
"dev.flutter.pigeon.firebase_app_check_platform_interface.FirebaseAppCheckHostApi.registerTokenListener$separatedMessageChannelSuffix",
codec)
val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.firebase_app_check_platform_interface.FirebaseAppCheckHostApi.registerTokenListener$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List<Any?>
Expand All @@ -195,11 +161,7 @@ interface FirebaseAppCheckHostApi {
}
}
run {
val channel =
BasicMessageChannel<Any?>(
binaryMessenger,
"dev.flutter.pigeon.firebase_app_check_platform_interface.FirebaseAppCheckHostApi.getLimitedUseAppCheckToken$separatedMessageChannelSuffix",
codec)
val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.firebase_app_check_platform_interface.FirebaseAppCheckHostApi.getLimitedUseAppCheckToken$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List<Any?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ plugins {
// START: FlutterFire Configuration
id "com.google.gms.google-services" version "4.3.15" apply false
// END: FlutterFire Configuration
id "org.jetbrains.kotlin.android" version "1.9.22" apply false
id "org.jetbrains.kotlin.android" version "2.1.0" apply false
}

include ":app"
Loading
Loading