简体   繁体   中英

How to get fingerprint dat in ios 8?

For this i use La Authentication framework but with the help of that i don't got fingerprint data and it just returns me boolean value ie true and false , so it cant help i want fingerprint data in variable so further i will process it. Help me.

following is the sample code,

func authenticateUser() {
  ...

  // Check if the device can evaluate the policy.
  if context.canEvaluatePolicy(LAPolicy.DeviceOwnerAuthenticationWithBiometrics, error: &error) {
    [context .evaluatePolicy(LAPolicy.DeviceOwnerAuthenticationWithBiometrics, localizedReason: reasonString, reply: { (success: Bool, evalPolicyError: NSError?) -> Void in

      if success {

      }
      else {
        // If authentication failed then show a message to the console with a short description.
        // In case that the error is a user fallback, then show the password alert view.
        println(evalPolicyError?.localizedDescription)

        switch evalPolicyError!.code {
          case LAError.SystemCancel.toRaw():
            println("Authentication was cancelled by the system")

          case LAError.UserCancel.toRaw():
            println("Authentication was cancelled by the user")

          case LAError.UserFallback.toRaw():
            println("User selected to enter custom password")
            NSOperationQueue.mainQueue().addOperationWithBlock({ () -> Void in
              self.showPasswordAlert()
            })

          default:
            println("Authentication failed")
            NSOperationQueue.mainQueue().addOperationWithBlock({ () -> Void in
              self.showPasswordAlert()
            })
        }
      }
    })]
  }
}

You can't, Apple does not allow access to the fingerprint data. This has to do with security.

The iOS SDK only allows you let a user validate them selfs with the Touch ID.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM