簡體   English   中英

如何在iOS 8中獲取指紋數據?

[英]How to get fingerprint dat in ios 8?

為此,我使用La Authentication框架,但借助該方法,我沒有指紋數據,它只返回布爾值(即true和false),所以它無法幫助我獲取變量中的指紋數據,因此我將對其進行進一步處理。 幫我。

以下是示例代碼,

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()
            })
        }
      }
    })]
  }
}

您不能,Apple不允許訪問指紋數據。 這與安全性有關。

iOS SDK僅允許您讓用戶使用Touch ID驗證自己。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM