File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -80,7 +80,10 @@ class BiometricStorageImpl {
8080 }
8181
8282 if ( " canAuthenticate " == call. method) {
83- canAuthenticate ( result: result)
83+ requiredArg ( " options " ) { options in
84+ let initOptions = InitOptions ( params: options)
85+ canAuthenticate ( options: initOptions, result: result)
86+ }
8487 } else if ( " init " == call. method) {
8588 requiredArg ( " name " ) { name in
8689 requiredArg ( " options " ) { options in
@@ -123,10 +126,11 @@ class BiometricStorageImpl {
123126 }
124127
125128
126- private func canAuthenticate( result: @escaping StorageCallback ) {
129+ private func canAuthenticate( options : InitOptions , result: @escaping StorageCallback ) {
127130 var error : NSError ?
128131 let context = LAContext ( )
129- if context. canEvaluatePolicy ( . deviceOwnerAuthentication, error: & error) {
132+ let policy : LAPolicy = options. darwinBiometricOnly ? . deviceOwnerAuthenticationWithBiometrics : . deviceOwnerAuthentication
133+ if context. canEvaluatePolicy ( policy, error: & error) {
130134 result ( " Success " )
131135 return
132136 }
You can’t perform that action at this time.
0 commit comments