OneTap

class OneTap @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0) : FrameLayout

OneTap is a view that provides VKID One Tap login interface. For more information how to integrate VK ID Authentication check docs https://id.vk.com/business/go/docs/ru/vkid/latest/vk-id/intro/plan

You should setCallbacks on init view to get token after successful auth.

Constructors

Link copied to clipboard
constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0)

Properties

Link copied to clipboard

Optional params to be passed to auth. See VKIDAuthUiParams.Builder for more info.

Link copied to clipboard

Whether to fetch user. Defaults to true. In case this parameter is set to false the user data won't be fetched and user will have to confirm authorization on click. Note: this parameter doesn't support changes in runtime and must be initialized when the view is constructed. Note: This parameter will hide "change account" button because in this case OneTap will have the same behaviour.

Link copied to clipboard

Flag to enable a button for signing into another account. Note that if text doesn't fit the available width the view will be hidden regardless of the flag.

Link copied to clipboard

Adds support multibranding auth. By default this widget is not displayed. This property represents a set of OneTapOAuth to be displayed.

Link copied to clipboard

Scenario for which the OneTap is used. Changes title accordingly.

Link copied to clipboard

The styling for the One Tap interface, default is OneTapStyle.Light

Functions

Link copied to clipboard
fun setCallbacks(onAuth: (oAuth: OneTapOAuth?, accessToken: AccessToken) -> Unit, onFail: (oAuth: OneTapOAuth?, fail: VKIDAuthFail) -> Unit = { _, _ -> }, onAuthCode: (data: AuthCodeData, isCompletion: Boolean) -> Unit = { _, _ -> })

Callbacks that provide auth result for version with multibranding.