feat(biometric): add macOS Touch ID support via LocalAuthentication framework (#3264)

* feat(biometric): add macOS Touch ID support via LocalAuthentication framework

* cleanup

* fmt

* change file

* fix tests

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
This commit is contained in:
Masayoshi TakahashiandLucas Nogueira authored and GitHub committed 2026-10-11 21:56:15 -03:00
1 parent a819187e12
commit 2ebe54abce
17 files changed
+439 -68

No files matched your search

+3 -3
View File
@@ -39,6 +39,7 @@ import type * as WindowState from '@tauri-apps/plugin-window-state'
* only have a default export, so their global is that class itself.
*/
export interface CommonPluginApi {
biometric: typeof Biometric
clipboardManager: typeof ClipboardManager
deepLink: typeof DeepLink
dialog: typeof Dialog
@@ -69,7 +70,6 @@ export interface DesktopPluginApi {
/** The plugin APIs the example only registers on mobile (`#[cfg(mobile)]`). */
export interface MobilePluginApi {
barcodeScanner: typeof BarcodeScanner
biometric: typeof Biometric
geolocation: typeof Geolocation
haptics: typeof Haptics
nfc: typeof Nfc
@@ -265,8 +265,8 @@ export interface DescribePluginOptions {
desktopOnly?: boolean
/**
* The example only registers the plugin on mobile (`barcode-scanner`,
* `biometric`, `geolocation`, `haptics`, `nfc`), so the whole suite is
* skipped on desktop.
* `geolocation`, `haptics`, `nfc`), so the whole suite is skipped on
* desktop.
*/
mobileOnly?: boolean
}
+1 -1
View File
@@ -23,6 +23,7 @@ type Surface<T> = { [P in keyof T]: (keyof T[P])[] }
/** Plugins the example registers on every platform. */
const commonSurface: Surface<CommonPluginApi> = {
biometric: ['BiometryType', 'checkStatus', 'authenticate'],
clipboardManager: [
'writeText',
'readText',
@@ -144,7 +145,6 @@ const mobileSurface: Surface<MobilePluginApi> = {
'requestPermissions',
'openAppSettings'
],
biometric: ['BiometryType', 'checkStatus', 'authenticate'],
geolocation: [
'watchPosition',
'getCurrentPosition',