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
5 changes: 5 additions & 0 deletions auth/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@
android:label="@string/fui_default_toolbar_title"
android:exported="false" />

<activity
android:name=".compose.FirebaseAuthActivity"
android:label=""
android:exported="false" />

<activity
android:name="com.facebook.FacebookActivity"
android:label="@string/app_name"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import android.content.Intent
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.lifecycle.lifecycleScope
Expand Down Expand Up @@ -76,6 +77,7 @@ class FirebaseAuthActivity : ComponentActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge()

// Extract configuration from cache using UUID key
val configKey = intent.getStringExtra(EXTRA_CONFIGURATION_KEY)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import com.firebase.ui.auth.compose.FirebaseAuthUI
import com.firebase.ui.auth.compose.configuration.PasswordRule
import com.firebase.ui.auth.compose.configuration.authUIConfiguration
import com.firebase.ui.auth.compose.configuration.auth_provider.AuthProvider
import com.firebase.ui.auth.compose.configuration.string_provider.LocalAuthUIStringProvider
import com.firebase.ui.auth.compose.configuration.theme.AuthUIAsset
import com.firebase.ui.auth.compose.configuration.theme.AuthUITheme
import com.firebase.ui.auth.compose.ui.screens.EmailAuthContentState
Expand Down Expand Up @@ -275,22 +276,25 @@ fun EmailAuthDemo(
}
} else {
// Show custom email auth UI using slot API
EmailAuthScreen(
context = context,
configuration = configuration,
authUI = authUI,
onSuccess = { result: AuthResult ->
Log.d("CustomSlotsDemo", "Email auth success: ${result.user?.uid}")
},
onError = { exception: AuthException ->
Log.e("CustomSlotsDemo", "Email auth error", exception)
},
onCancel = {
Log.d("CustomSlotsDemo", "Email auth cancelled")
// Provide the string provider required by EmailAuthScreen
CompositionLocalProvider(LocalAuthUIStringProvider provides configuration.stringProvider) {
EmailAuthScreen(
context = context,
configuration = configuration,
authUI = authUI,
onSuccess = { result: AuthResult ->
Log.d("CustomSlotsDemo", "Email auth success: ${result.user?.uid}")
},
onError = { exception: AuthException ->
Log.e("CustomSlotsDemo", "Email auth error", exception)
},
onCancel = {
Log.d("CustomSlotsDemo", "Email auth cancelled")
}
) { state: EmailAuthContentState ->
// Custom UI using the slot API
CustomEmailAuthUI(state)
}
) { state: EmailAuthContentState ->
// Custom UI using the slot API
CustomEmailAuthUI(state)
}
}
}
Expand Down Expand Up @@ -609,22 +613,25 @@ fun PhoneAuthDemo(
}
} else {
// Show custom phone auth UI using slot API
PhoneAuthScreen(
context = context,
configuration = configuration,
authUI = authUI,
onSuccess = { result: AuthResult ->
Log.d("CustomSlotsDemo", "Phone auth success: ${result.user?.uid}")
},
onError = { exception: AuthException ->
Log.e("CustomSlotsDemo", "Phone auth error", exception)
},
onCancel = {
Log.d("CustomSlotsDemo", "Phone auth cancelled")
// Provide the string provider required by PhoneAuthScreen
CompositionLocalProvider(LocalAuthUIStringProvider provides configuration.stringProvider) {
PhoneAuthScreen(
context = context,
configuration = configuration,
authUI = authUI,
onSuccess = { result: AuthResult ->
Log.d("CustomSlotsDemo", "Phone auth success: ${result.user?.uid}")
},
onError = { exception: AuthException ->
Log.e("CustomSlotsDemo", "Phone auth error", exception)
},
onCancel = {
Log.d("CustomSlotsDemo", "Phone auth cancelled")
}
) { state: PhoneAuthContentState ->
// Custom UI using the slot API
CustomPhoneAuthUI(state)
}
) { state: PhoneAuthContentState ->
// Custom UI using the slot API
CustomPhoneAuthUI(state)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class HighLevelApiDemoActivity : ComponentActivity() {

val configuration = authUIConfiguration {
context = applicationContext
locale = Locale.GERMANY
providers {
provider(AuthProvider.Anonymous)
provider(
Expand Down Expand Up @@ -99,8 +98,8 @@ class HighLevelApiDemoActivity : ComponentActivity() {
)
provider(
AuthProvider.Apple(
locale = "DE",
customParameters = emptyMap()
customParameters = emptyMap(),
locale = null
)
)
provider(
Expand Down