ClipboardOtpDetector

Detects OTP codes from clipboard text without polling.

Tracks the last clipboard snapshot and handled code so the same suggestion is not shown repeatedly until the clipboard content changes.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun detect(clipboardText: String?, length: Int, allowedChars: OtpAllowedChars = OtpAllowedChars.DigitsOnly): String?

Returns a valid OTP extracted from clipboardText, or null when nothing should be suggested.

Link copied to clipboard
fun markHandled(code: String)

Call when the user applies or dismisses a suggestion so it is not shown again.

Link copied to clipboard
fun reset()

Clears tracking state — useful in tests.