AuthTabIntent.AuthenticateUserResultContract


public class AuthTabIntent.AuthenticateUserResultContract extends 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 methods

@NonNull Intent

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

@NonNull AuthTabIntent.AuthResult
parseResult(int resultCode, @Nullable Intent intent)

Parses the result from the Auth Tab into an AuthResult.

Inherited methods

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

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
public AuthenticateUserResultContract()

Public methods

createIntent

public @NonNull Intent createIntent(@NonNull Context context, @NonNull Intent input)

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

Parameters
@NonNull Context context

The context from which the activity is being launched.

@NonNull Intent input

The Intent built by AuthTabIntent.Builder.

Returns
@NonNull Intent

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

parseResult

public @NonNull AuthTabIntent.AuthResult parseResult(int resultCode, @Nullable Intent intent)

Parses the result from the Auth Tab into an AuthResult.

Parameters
int resultCode

The result code returned by the activity.

@Nullable Intent intent

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

Returns
@NonNull AuthTabIntent.AuthResult

An AuthResult representing the outcome of the authentication flow.