Skip to content

AndroidAuthSessionOptionsBuilder

Fluent builder for AndroidAuthSessionOptions. Options not configured use the system or browser default.

Kodster.InAppWebBrowser.Android.AndroidAuthSessionOptionsBuilder

Overview

Each With* method returns the same builder instance for fluent chaining. Call Build() to create the final AndroidAuthSessionOptions object.

Example

#if UNITY_ANDROID
var options = new AndroidAuthSessionOptionsBuilder()
    .WithColorScheme(AndroidColorScheme.Dark)
    .WithEphemeralBrowsingEnabled(true)
    .Build();

var result = await AndroidAuthSession.StartAsync(url, redirectScheme, options);
#endif

Methods

WithColorScheme

public AndroidAuthSessionOptionsBuilder WithColorScheme(
    AndroidColorScheme androidColorScheme
)

Sets the color scheme used for the session UI.

Parameters

  • androidColorScheme (AndroidColorScheme): The color scheme to apply.

Returns

  • The current AndroidAuthSessionOptionsBuilder instance.

WithLightColorSchemeOptions

public AndroidAuthSessionOptionsBuilder WithLightColorSchemeOptions(
    ColorSchemeOptions lightColorSchemeOptions
)

Sets the color customization applied when the session is in light mode.

Parameters

  • lightColorSchemeOptions (ColorSchemeOptions): Color overrides for light mode.

Returns

  • The current AndroidAuthSessionOptionsBuilder instance.

WithDarkColorSchemeOptions

public AndroidAuthSessionOptionsBuilder WithDarkColorSchemeOptions(
    ColorSchemeOptions darkColorSchemeOptions
)

Sets the color customization applied when the session is in dark mode.

Parameters

  • darkColorSchemeOptions (ColorSchemeOptions): Color overrides for dark mode.

Returns

  • The current AndroidAuthSessionOptionsBuilder instance.

WithDefaultColorSchemeOptions

public AndroidAuthSessionOptionsBuilder WithDefaultColorSchemeOptions(
    ColorSchemeOptions defaultColorSchemeOptions
)

Sets the fallback color customization used when no mode-specific options are matched.

Parameters

  • defaultColorSchemeOptions (ColorSchemeOptions): Fallback color overrides.

Returns

  • The current AndroidAuthSessionOptionsBuilder instance.

WithEphemeralBrowsingEnabled

public AndroidAuthSessionOptionsBuilder WithEphemeralBrowsingEnabled(
    bool ephemeralBrowsingEnabled
)

Sets whether the session clears cookies and browsing data when closed.

Parameters

  • ephemeralBrowsingEnabled (bool): true to enable ephemeral browsing; otherwise false.

Returns

  • The current AndroidAuthSessionOptionsBuilder instance.

WithCloseButtonIcon

public AndroidAuthSessionOptionsBuilder WithCloseButtonIcon(
    CloseButtonIcon closeButtonIcon
)

Sets the icon displayed on the close button.

Parameters

  • closeButtonIcon (CloseButtonIcon): The icon style to use.

Returns

  • The current AndroidAuthSessionOptionsBuilder instance.

Build

public AndroidAuthSessionOptions Build()

Builds and returns an AndroidAuthSessionOptions instance from the current configuration. Only options explicitly set via the With* methods are included; unset options remain null.

Returns

  • A new AndroidAuthSessionOptions instance reflecting the builder's current state.