AuthTabIntent.AuthenticateUserResultContract


class AuthTabIntent.AuthenticateUserResultContract : ActivityResultContract


An ActivityResultContract for launching an Auth Tab and receiving the result. This contract takes the launch Intent as input and produces an AuthResult as output.

Summary

Public constructors

Public functions

Intent
createIntent(context: Context, input: Intent)

Creates the Intent to be used to launch the Auth Tab activity.

AuthTabIntent.AuthResult
parseResult(resultCode: Int, intent: Intent?)

Parses the result from the Auth Tab into an AuthResult.

Inherited functions

From androidx.activity.result.contract.ActivityResultContract
ActivityResultContract.SynchronousResult<O!>!
getSynchronousResult(context: Context!, input: I!)

An optional method you can implement that can be used to potentially provide a result in lieu of starting an activity.

Public constructors

AuthenticateUserResultContract

Added in 1.10.0-alpha02
AuthenticateUserResultContract()

Public functions

createIntent

fun createIntent(context: Context, input: Intent): Intent

Creates the Intent to be used to launch the Auth Tab activity.

Parameters
context: Context

The context from which the activity is being launched.

input: Intent

The Intent built by AuthTabIntent.Builder.

Returns
Intent

The same Intent that was passed as input, which will be used to start the activity.

parseResult

fun parseResult(resultCode: Int, intent: Intent?): AuthTabIntent.AuthResult

Parses the result from the Auth Tab into an AuthResult.

Parameters
resultCode: Int

The result code returned by the activity.

intent: Intent?

The Intent returned by the activity, which may contain result data.

Returns
AuthTabIntent.AuthResult

An AuthResult representing the outcome of the authentication flow.