Skip to content

feat(android): isEnabled() check#351

Open
m1ga wants to merge 2 commits into
masterfrom
androidEnabled
Open

feat(android): isEnabled() check#351
m1ga wants to merge 2 commits into
masterfrom
androidEnabled

Conversation

@m1ga
Copy link
Copy Markdown
Contributor

@m1ga m1ga commented Jan 30, 2026

  • new method isEnabled() that will show true/false if you have biometrics but they are disabled
  • authenticate() will call the error callback if biometrics are disabled
  • removed some minSdk checks as Ti 13.1.0 is minSdk 24 now by default
  • fixed manifest version number

ti.identity-android-3.3.0.zip

Note:
authenticate() will currently also fail if the device has the feature disabled. isSupported() is still showing true because the devices HAS the features. The isEnabled() will do the same checks as authenticate() but won't show the dialog in case it is true. So you can use the check beforehand.

Comment thread apidoc/Identity.yml
Comment on lines +162 to +169
- name: isEnabled
summary: Determines if the current state of the biometric authentication.
description: |
Will return `false` if the device has biometrics but they are disabled
platforms: [android]
since: "13.1.1"
returns:
type: Boolean
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be part of isSupported, as non-enabled and non-supported should both be handled as an error

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this way you can differentiate between: device doesn't have biometrics and "has it but disabled". So you can alert the user to enable it.

Copy link
Copy Markdown
Contributor

@hansemannn hansemannn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should reuse the existing isSupported API, the rest looks fine. Do you know if this also addresses an issue where the missing fingerprint does not show the PIN code field as a fallback? Does Android support this in general? It popped up for our app, so I was curious if there is a way to do that.

@m1ga
Copy link
Copy Markdown
Contributor Author

m1ga commented Apr 10, 2026

I thought the system handles that automatically because all are allowed:

.setAllowedAuthenticators(BiometricManager.Authenticators.DEVICE_CREDENTIAL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants