IOS8 get fingerprint data

前端 未结 2 1155
隐瞒了意图╮
隐瞒了意图╮ 2021-01-16 19:15

in IOS8 can i take the fingerprint data and save it or use it somewhere else ,

this Code to Authoticate

- (void)authenicateButtonTapped:(id)sende         


        
相关标签:
2条回答
  • 2021-01-16 19:35

    You can authenticate like this way:

     func authenticateUser() {
        let context = LAContext()
        var error: NSError?
    
        if context.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &error) {
            let reason = "Identify yourself!"
    
            context.evaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, localizedReason: reason) {
                [unowned self] success, authenticationError in
    
                DispatchQueue.main.async {
                    if success {
                        let ac = UIAlertController(title: "Login with TouchID", message: "Sucessfully Login", preferredStyle: .alert)
                        ac.addAction(UIAlertAction(title: "OK", style: .default))
                        self.present(ac, animated: true)
                    } else {
                        let ac = UIAlertController(title: "Authentication failed", message: "Sorry!", preferredStyle: .alert)
                        ac.addAction(UIAlertAction(title: "OK", style: .default))
                        self.present(ac, animated: true)
                    }
                }
            }
        } else {
            let ac = UIAlertController(title: "Touch ID not available", message: "Your device is not configured for Touch ID.", preferredStyle: .alert)
            ac.addAction(UIAlertAction(title: "OK", style: .default))
            present(ac, animated: true)
        }
    }
    

    0 讨论(0)
  • 2021-01-16 19:41

    No you can not read or save fingerprint data. Even Apple does not collect this data. You can only use the Touch ID sensor to unlock your app with the fingerprints the user has already saved in the system preferences.

    0 讨论(0)
提交回复
热议问题