rememberFacebookSignInState

Facebook Sign-In (without any backend) as a Compose state holder.

Parameters are read at launch time: recomposing with new values updates the existing state, and SignInState.launch uses whatever is current when the user taps.

val facebookSignIn = rememberFacebookSignInState(onResult = { result ->
val accessToken = result.getOrNull()?.accessToken // send to your backend
})

Button(onClick = { facebookSignIn.launch() }) { Text("Facebook Sign-In (Custom Design)") }

Parameters

requestScopes

Request Scopes that is provided in Facebook OAuth. By Default, user's email and public profile info is requested.

linkAccount

Boolean flag to link account with current user. Default value is false.

loginTracking

FacebookLoginTracking mode controlling which token is returned. Defaults to FacebookLoginTracking.Limited (privacy-friendly OIDC JWT + nonce); use FacebookLoginTracking.Enabled to receive a Graph-API access token. See FacebookLoginTracking for the trade-offs.

onResult

receives the signed-in FacebookUser or the failure.

expect fun rememberFacebookSignInState(requestScopes: List<FacebookSignInRequestScope> = listOf( FacebookSignInRequestScope.PublicProfile, FacebookSignInRequestScope.Email ), linkAccount: Boolean = false, loginTracking: FacebookLoginTracking = FacebookLoginTracking.Limited, onResult: (Result<FacebookUser>) -> Unit): SignInState

Facebook Sign-In (without any backend) as a Compose state holder.

Parameters are read at launch time: recomposing with new values updates the existing state, and SignInState.launch uses whatever is current when the user taps.

val facebookSignIn = rememberFacebookSignInState(onResult = { result ->
val accessToken = result.getOrNull()?.accessToken // send to your backend
})

Button(onClick = { facebookSignIn.launch() }) { Text("Facebook Sign-In (Custom Design)") }

Parameters

requestScopes

Request Scopes that is provided in Facebook OAuth. By Default, user's email and public profile info is requested.

linkAccount

Boolean flag to link account with current user. Default value is false.

loginTracking

FacebookLoginTracking mode controlling which token is returned. Defaults to FacebookLoginTracking.Limited (privacy-friendly OIDC JWT + nonce); use FacebookLoginTracking.Enabled to receive a Graph-API access token. See FacebookLoginTracking for the trade-offs.

onResult

receives the signed-in FacebookUser or the failure.

Facebook Sign-In (without any backend) as a Compose state holder.

Parameters are read at launch time: recomposing with new values updates the existing state, and SignInState.launch uses whatever is current when the user taps.

val facebookSignIn = rememberFacebookSignInState(onResult = { result ->
val accessToken = result.getOrNull()?.accessToken // send to your backend
})

Button(onClick = { facebookSignIn.launch() }) { Text("Facebook Sign-In (Custom Design)") }

Parameters

requestScopes

Request Scopes that is provided in Facebook OAuth. By Default, user's email and public profile info is requested.

linkAccount

Boolean flag to link account with current user. Default value is false.

loginTracking

FacebookLoginTracking mode controlling which token is returned. Defaults to FacebookLoginTracking.Limited (privacy-friendly OIDC JWT + nonce); use FacebookLoginTracking.Enabled to receive a Graph-API access token. See FacebookLoginTracking for the trade-offs.

onResult

receives the signed-in FacebookUser or the failure.

Facebook Sign-In (without any backend) as a Compose state holder.

Parameters are read at launch time: recomposing with new values updates the existing state, and SignInState.launch uses whatever is current when the user taps.

val facebookSignIn = rememberFacebookSignInState(onResult = { result ->
val accessToken = result.getOrNull()?.accessToken // send to your backend
})

Button(onClick = { facebookSignIn.launch() }) { Text("Facebook Sign-In (Custom Design)") }

Parameters

requestScopes

Request Scopes that is provided in Facebook OAuth. By Default, user's email and public profile info is requested.

linkAccount

Boolean flag to link account with current user. Default value is false.

loginTracking

FacebookLoginTracking mode controlling which token is returned. Defaults to FacebookLoginTracking.Limited (privacy-friendly OIDC JWT + nonce); use FacebookLoginTracking.Enabled to receive a Graph-API access token. See FacebookLoginTracking for the trade-offs.

onResult

receives the signed-in FacebookUser or the failure.

Facebook Sign-In (without any backend) as a Compose state holder.

Parameters are read at launch time: recomposing with new values updates the existing state, and SignInState.launch uses whatever is current when the user taps.

val facebookSignIn = rememberFacebookSignInState(onResult = { result ->
val accessToken = result.getOrNull()?.accessToken // send to your backend
})

Button(onClick = { facebookSignIn.launch() }) { Text("Facebook Sign-In (Custom Design)") }

Parameters

requestScopes

Request Scopes that is provided in Facebook OAuth. By Default, user's email and public profile info is requested.

linkAccount

Boolean flag to link account with current user. Default value is false.

loginTracking

FacebookLoginTracking mode controlling which token is returned. Defaults to FacebookLoginTracking.Limited (privacy-friendly OIDC JWT + nonce); use FacebookLoginTracking.Enabled to receive a Graph-API access token. See FacebookLoginTracking for the trade-offs.

onResult

receives the signed-in FacebookUser or the failure.

Facebook Sign-In (without any backend) as a Compose state holder.

Parameters are read at launch time: recomposing with new values updates the existing state, and SignInState.launch uses whatever is current when the user taps.

val facebookSignIn = rememberFacebookSignInState(onResult = { result ->
val accessToken = result.getOrNull()?.accessToken // send to your backend
})

Button(onClick = { facebookSignIn.launch() }) { Text("Facebook Sign-In (Custom Design)") }

Parameters

requestScopes

Request Scopes that is provided in Facebook OAuth. By Default, user's email and public profile info is requested.

linkAccount

Boolean flag to link account with current user. Default value is false.

loginTracking

FacebookLoginTracking mode controlling which token is returned. Defaults to FacebookLoginTracking.Limited (privacy-friendly OIDC JWT + nonce); use FacebookLoginTracking.Enabled to receive a Graph-API access token. See FacebookLoginTracking for the trade-offs.

onResult

receives the signed-in FacebookUser or the failure.