Skip to content

Commit d12d750

Browse files
committed
docs: correct the auth README and getting-started guide against the GA API surface (#2544)
1 parent 5f8f275 commit d12d750

10 files changed

Lines changed: 612 additions & 336 deletions

File tree

‎.agents/skills/firebaseui-android-getting-started/SKILL.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ android {
6161
}
6262

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

66-
implementation(platform("com.google.firebase:firebase-bom:34.7.0"))
66+
implementation(platform("com.google.firebase:firebase-bom:34.19.0"))
6767
implementation("com.google.firebase:firebase-auth")
6868

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

8080
```kotlin
81-
implementation("com.facebook.android:facebook-login:18.0.3")
81+
implementation("com.facebook.android:facebook-login:18.3.0")
8282
```
8383

84-
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.
84+
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.
8585

8686
## Predefined Auth Screen Template
8787

‎GETTING_STARTED.md‎

Lines changed: 103 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
[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.
44

5-
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.
6-
75
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.
86

97
FirebaseUI Auth provides the following benefits:
@@ -20,17 +18,39 @@ FirebaseUI Auth provides the following benefits:
2018

2119
1. If you haven't already, [add Firebase to your Android project](https://firebase.google.com/docs/android/setup).
2220
2. In the [Firebase console](https://console.firebase.google.com/), enable the sign-in methods you want to support.
23-
3. Add FirebaseUI Auth to your app module:
21+
3. Check that your app module meets the minimum requirements:
22+
23+
- Android SDK 23+ (Android 6.0 Marshmallow)
24+
- Kotlin 2.3+
25+
- Jetpack Compose, with the Compose compiler plugin applied
26+
- Firebase BoM 34.0.0+
27+
28+
4. Add the Compose compiler plugin and FirebaseUI Auth to your app module:
2429

2530
```kotlin
31+
plugins {
32+
id("org.jetbrains.kotlin.plugin.compose")
33+
}
34+
35+
android {
36+
buildFeatures {
37+
compose = true
38+
}
39+
}
40+
2641
dependencies {
2742
// Check Maven Central for the latest version:
2843
// https://central.sonatype.com/artifact/com.firebaseui/firebase-ui-auth/versions
29-
implementation("com.firebaseui:firebase-ui-auth:10.0.0-beta05")
44+
implementation("com.firebaseui:firebase-ui-auth:10.0.0")
45+
46+
// Required: Jetpack Compose
47+
implementation(platform("androidx.compose:compose-bom:2026.09.00"))
48+
implementation("androidx.compose.ui:ui")
49+
implementation("androidx.compose.material3:material3")
3050

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

@@ -122,21 +142,29 @@ class MainActivity : ComponentActivity() {
122142

123143
setContent {
124144
MyAppTheme {
125-
val configuration = authUIConfiguration {
126-
context = applicationContext
127-
theme = AuthUITheme.fromMaterialTheme()
128-
providers {
129-
provider(AuthProvider.Email())
130-
provider(
131-
AuthProvider.Google(
132-
scopes = listOf("email"),
133-
serverClientId = null,
145+
// Resolved here: the theme is @Composable, the builder lambda is not.
146+
val authTheme = AuthUITheme.fromMaterialTheme()
147+
148+
val configuration = remember(authTheme) {
149+
authUIConfiguration {
150+
context = applicationContext
151+
theme = authTheme
152+
providers {
153+
provider(AuthProvider.Email())
154+
provider(
155+
AuthProvider.Google(
156+
scopes = listOf("email"),
157+
serverClientId = null,
158+
)
134159
)
135-
)
160+
}
136161
}
137162
}
138163

139-
if (authUI.isSignedIn()) {
164+
val authState by remember(authUI) { authUI.authStateFlow() }
165+
.collectAsState(initial = AuthState.Idle)
166+
167+
if (authState is AuthState.Success) {
140168
HomeScreen()
141169
} else {
142170
FirebaseAuthScreen(
@@ -149,7 +177,8 @@ class MainActivity : ComponentActivity() {
149177
// Sign in failed
150178
},
151179
onSignInCancelled = {
152-
finish()
180+
// The user cancelled one sign-in attempt; the screen resets
181+
// on its own.
153182
},
154183
)
155184
}
@@ -186,16 +215,25 @@ lifecycleScope.launch {
186215

187216
## Customization
188217

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

191220
```kotlin
192-
val configuration = authUIConfiguration {
193-
context = applicationContext
194-
providers {
195-
provider(AuthProvider.Email())
196-
provider(AuthProvider.Google(scopes = listOf("email"), serverClientId = null))
221+
@Composable
222+
fun rememberAuthConfiguration(): AuthUIConfiguration {
223+
val appContext = LocalContext.current.applicationContext
224+
// Resolved here: the theme is @Composable, the builder lambda is not.
225+
val authTheme = AuthUITheme.Adaptive
226+
227+
return remember(appContext, authTheme) {
228+
authUIConfiguration {
229+
context = appContext
230+
providers {
231+
provider(AuthProvider.Email())
232+
provider(AuthProvider.Google(scopes = listOf("email"), serverClientId = null))
233+
}
234+
theme = authTheme
235+
}
197236
}
198-
theme = AuthUITheme.Adaptive
199237
}
200238
```
201239

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

216254
```kotlin
217-
private val authLauncher = registerForActivityResult(
218-
ActivityResultContracts.StartActivityForResult(),
219-
) { result ->
220-
if (result.resultCode == RESULT_OK) {
221-
val user = FirebaseAuth.getInstance().currentUser
222-
// ...
223-
} else {
224-
// User cancelled or sign-in failed
255+
class MainActivity : ComponentActivity() {
256+
private lateinit var authController: AuthFlowController
257+
258+
// A property initializer, so registration happens before the Activity reaches STARTED.
259+
private val authLauncher = registerForActivityResult(
260+
ActivityResultContracts.StartActivityForResult(),
261+
) { result ->
262+
if (result.resultCode == RESULT_OK) {
263+
val user = FirebaseAuth.getInstance().currentUser
264+
// ...
265+
} else {
266+
// User cancelled or sign-in failed
267+
}
225268
}
226-
}
227269

228-
val configuration = authUIConfiguration {
229-
context = applicationContext
230-
providers {
231-
provider(AuthProvider.Email())
232-
provider(
233-
AuthProvider.Google(
234-
scopes = listOf("email"),
235-
serverClientId = null,
236-
)
237-
)
270+
override fun onCreate(savedInstanceState: Bundle?) {
271+
super.onCreate(savedInstanceState)
272+
273+
val configuration = authUIConfiguration {
274+
context = applicationContext
275+
providers {
276+
provider(AuthProvider.Email())
277+
provider(
278+
AuthProvider.Google(
279+
scopes = listOf("email"),
280+
serverClientId = null,
281+
)
282+
)
283+
}
284+
}
285+
286+
authController = FirebaseAuthUI.getInstance().createAuthFlow(configuration)
287+
// Only on first creation: a recreated Activity would otherwise launch a second flow.
288+
if (savedInstanceState == null) {
289+
authLauncher.launch(authController.createIntent(this))
290+
}
238291
}
239-
}
240292

241-
val controller = FirebaseAuthUI.getInstance().createAuthFlow(configuration)
242-
authLauncher.launch(controller.createIntent(this))
293+
override fun onDestroy() {
294+
super.onDestroy()
295+
// Required.
296+
authController.dispose()
297+
}
298+
}
243299
```

‎README.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,21 +48,21 @@ libraries.
4848
```groovy
4949
dependencies {
5050
// FirebaseUI for Firebase Realtime Database
51-
implementation 'com.firebaseui:firebase-ui-database:10.0.0-beta05'
51+
implementation 'com.firebaseui:firebase-ui-database:10.0.0'
5252
5353
// FirebaseUI for Cloud Firestore
54-
implementation 'com.firebaseui:firebase-ui-firestore:10.0.0-beta05'
54+
implementation 'com.firebaseui:firebase-ui-firestore:10.0.0'
5555
5656
// FirebaseUI for Firebase Auth
57-
implementation 'com.firebaseui:firebase-ui-auth:10.0.0-beta05'
57+
implementation 'com.firebaseui:firebase-ui-auth:10.0.0'
5858
5959
// FirebaseUI for Cloud Storage
60-
implementation 'com.firebaseui:firebase-ui-storage:10.0.0-beta05'
60+
implementation 'com.firebaseui:firebase-ui-storage:10.0.0'
6161
}
6262
```
6363

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

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

0 commit comments

Comments
 (0)