onFocusChange

fun onFocusChange(focus: Boolean, keyContext: String)

This is for situations where text input is not handled through a standard Android UI Text component. This includes: Jetpack Compose React Native Onscreen Keyboards Where input is handled through a standard text field, this should not be used. Normally work with onTextChange on Jetpack Compose or onKeyPress on React Native App

    // Jetpack Compose
PasswordField(
value = password,
onChange = {
password = it
sdk.onTextChange(password, "password") },
modifier = Modifier.fillMaxWidth()
.onFocusChanged {
sdk.onFocusChange(it.isFocused, "password")
}
)

// React Native
<TextInput
placeholder="Enter Password"
style={styles.inputField}
inputMode="text"
onKeyPress={event => {
let {key} = event.nativeEvent;
sdk.onKeyPress(key, "password")
}}
onFocus={_ => sdk.onFocusChange(true, "password")}
onBlur={_ => sdk.onFocusChange(false, "password")}
/>

notify biometrics module that a Field has changed focus.

Parameters

focus

true if the Field has focus, false otherwise

keyContext

the context of what the text field is being used for