Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 5 additions & 5 deletions .agents/skills/firebaseui-android-getting-started/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ android {
}

dependencies {
implementation("com.firebaseui:firebase-ui-auth:10.0.0-beta03")
implementation("com.firebaseui:firebase-ui-auth:10.0.0")

implementation(platform("com.google.firebase:firebase-bom:34.7.0"))
implementation(platform("com.google.firebase:firebase-bom:34.19.0"))
implementation("com.google.firebase:firebase-auth")

implementation(platform("androidx.compose:compose-bom:2025.10.00"))
implementation(platform("androidx.compose:compose-bom:2026.09.00"))
implementation("androidx.activity:activity-compose")
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.material3:material3")
Expand All @@ -78,10 +78,10 @@ Root/plugin configuration varies by project. If `com.google.gms.google-services`
Add provider-specific dependencies only when used. Facebook login needs:

```kotlin
implementation("com.facebook.android:facebook-login:18.0.3")
implementation("com.facebook.android:facebook-login:18.3.0")
```

Minimum expectations from the FirebaseUI Auth docs: Android SDK 21+, Kotlin 1.9+, Compose compiler 1.5+, and Firebase Auth 22.0.0+. Respect stricter versions already present in the user repo.
Minimum expectations from the FirebaseUI Auth docs: Android SDK 23+, Kotlin 2.3+, Jetpack Compose with the Compose compiler plugin applied, and Firebase BoM 34.0.0+. Respect stricter versions already present in the user repo.

## Predefined Auth Screen Template

Expand Down
150 changes: 103 additions & 47 deletions GETTING_STARTED.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

[FirebaseUI](https://github.com/firebase/firebaseui-android) Auth is a library built on top of the Firebase Authentication SDK that provides drop-in UI flows for use in your app.

Caution: Version 10.x is currently a **beta release**. This means that the functionality might change in backward-incompatible ways or have limited support. A beta release is not subject to any SLA or deprecation policy.

The recommended sign-in flow uses Compose screens. For apps that still use Activities, see the [Existing Activity-based apps](#existing-activity-based-apps) section.

FirebaseUI Auth provides the following benefits:
Expand All @@ -20,17 +18,39 @@ FirebaseUI Auth provides the following benefits:

1. If you haven't already, [add Firebase to your Android project](https://firebase.google.com/docs/android/setup).
2. In the [Firebase console](https://console.firebase.google.com/), enable the sign-in methods you want to support.
3. Add FirebaseUI Auth to your app module:
3. Check that your app module meets the minimum requirements:

- Android SDK 23+ (Android 6.0 Marshmallow)
- Kotlin 2.3+
- Jetpack Compose, with the Compose compiler plugin applied
- Firebase BoM 34.0.0+

4. Add the Compose compiler plugin and FirebaseUI Auth to your app module:

```kotlin
plugins {
id("org.jetbrains.kotlin.plugin.compose")
}

android {
buildFeatures {
compose = true
}
}

dependencies {
// Check Maven Central for the latest version:
// https://central.sonatype.com/artifact/com.firebaseui/firebase-ui-auth/versions
implementation("com.firebaseui:firebase-ui-auth:10.0.0-beta05")
implementation("com.firebaseui:firebase-ui-auth:10.0.0")

// Required: Jetpack Compose
implementation(platform("androidx.compose:compose-bom:2026.09.00"))
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.material3:material3")

// Required only if Facebook login support is required
// Find the latest Facebook SDK releases here: https://goo.gl/Ce5L94
implementation("com.facebook.android:facebook-android-sdk:8.x")
// Find the latest Facebook SDK releases here: https://github.com/facebook/facebook-android-sdk/releases
implementation("com.facebook.android:facebook-login:18.3.0")
}
```

Expand Down Expand Up @@ -122,21 +142,29 @@ class MainActivity : ComponentActivity() {

setContent {
MyAppTheme {
val configuration = authUIConfiguration {
context = applicationContext
theme = AuthUITheme.fromMaterialTheme()
providers {
provider(AuthProvider.Email())
provider(
AuthProvider.Google(
scopes = listOf("email"),
serverClientId = null,
// Resolved here: the theme is @Composable, the builder lambda is not.
val authTheme = AuthUITheme.fromMaterialTheme()

val configuration = remember(authTheme) {
authUIConfiguration {
context = applicationContext
theme = authTheme
providers {
provider(AuthProvider.Email())
provider(
AuthProvider.Google(
scopes = listOf("email"),
serverClientId = null,
)
)
)
}
}
}

if (authUI.isSignedIn()) {
val authState by remember(authUI) { authUI.authStateFlow() }
.collectAsState(initial = AuthState.Idle)

if (authState is AuthState.Success) {
HomeScreen()
} else {
FirebaseAuthScreen(
Expand All @@ -149,7 +177,8 @@ class MainActivity : ComponentActivity() {
// Sign in failed
},
onSignInCancelled = {
finish()
// The user cancelled one sign-in attempt; the screen resets
// on its own.
},
)
}
Expand Down Expand Up @@ -186,16 +215,25 @@ lifecycleScope.launch {

## Customization

FirebaseUI Auth is customizable, and the simplest way to get started is to set a theme directly in `authUIConfiguration`:
FirebaseUI Auth is customizable, and the simplest way to get started is to set a theme on `authUIConfiguration`:

```kotlin
val configuration = authUIConfiguration {
context = applicationContext
providers {
provider(AuthProvider.Email())
provider(AuthProvider.Google(scopes = listOf("email"), serverClientId = null))
@Composable
fun rememberAuthConfiguration(): AuthUIConfiguration {
val appContext = LocalContext.current.applicationContext
// Resolved here: the theme is @Composable, the builder lambda is not.
val authTheme = AuthUITheme.Adaptive

return remember(appContext, authTheme) {
authUIConfiguration {
context = appContext
providers {
provider(AuthProvider.Email())
provider(AuthProvider.Google(scopes = listOf("email"), serverClientId = null))
}
theme = authTheme
}
}
theme = AuthUITheme.Adaptive
}
```

Expand All @@ -214,30 +252,48 @@ For full theming and customization details, including theme precedence, provider
If your app still uses Activities and the Activity Result API, you can keep an Activity-based launch flow by using `AuthFlowController`:

```kotlin
private val authLauncher = registerForActivityResult(
ActivityResultContracts.StartActivityForResult(),
) { result ->
if (result.resultCode == RESULT_OK) {
val user = FirebaseAuth.getInstance().currentUser
// ...
} else {
// User cancelled or sign-in failed
class MainActivity : ComponentActivity() {
private lateinit var authController: AuthFlowController

// A property initializer, so registration happens before the Activity reaches STARTED.
private val authLauncher = registerForActivityResult(
ActivityResultContracts.StartActivityForResult(),
) { result ->
if (result.resultCode == RESULT_OK) {
val user = FirebaseAuth.getInstance().currentUser
// ...
} else {
// User cancelled or sign-in failed
}
}
}

val configuration = authUIConfiguration {
context = applicationContext
providers {
provider(AuthProvider.Email())
provider(
AuthProvider.Google(
scopes = listOf("email"),
serverClientId = null,
)
)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

val configuration = authUIConfiguration {
context = applicationContext
providers {
provider(AuthProvider.Email())
provider(
AuthProvider.Google(
scopes = listOf("email"),
serverClientId = null,
)
)
}
}

authController = FirebaseAuthUI.getInstance().createAuthFlow(configuration)
// Only on first creation: a recreated Activity would otherwise launch a second flow.
if (savedInstanceState == null) {
authLauncher.launch(authController.createIntent(this))
}
}
}

val controller = FirebaseAuthUI.getInstance().createAuthFlow(configuration)
authLauncher.launch(controller.createIntent(this))
override fun onDestroy() {
super.onDestroy()
// Required.
authController.dispose()
}
}
```
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,21 @@ libraries.
```groovy
dependencies {
// FirebaseUI for Firebase Realtime Database
implementation 'com.firebaseui:firebase-ui-database:10.0.0-beta05'
implementation 'com.firebaseui:firebase-ui-database:10.0.0'

// FirebaseUI for Cloud Firestore
implementation 'com.firebaseui:firebase-ui-firestore:10.0.0-beta05'
implementation 'com.firebaseui:firebase-ui-firestore:10.0.0'

// FirebaseUI for Firebase Auth
implementation 'com.firebaseui:firebase-ui-auth:10.0.0-beta05'
implementation 'com.firebaseui:firebase-ui-auth:10.0.0'

// FirebaseUI for Cloud Storage
implementation 'com.firebaseui:firebase-ui-storage:10.0.0-beta05'
implementation 'com.firebaseui:firebase-ui-storage:10.0.0'
}
```

If you're including the `firebase-ui-auth` dependency, there's a little
[more setup](auth/README.md#configuration) required.
[more setup](auth/README.md#setup) required.

After the project is synchronized, we're ready to start using Firebase functionality in our app.

Expand Down
Loading
Loading