TouchId & FaceId for IOS XOJO ?

  1. 5 weeks ago

    Aurelian N

    Jan 19 Pre-Release Testers, Xojo Pro

    Hello guys,

    Is. there a way to use Touch ID and Face ID in the apps done with XOJO for authentication ? If Yes, where I can find any code related to that ?

    Thanks.

  2. Dave S

    Jan 19 San Diego, California USA

    Might be easy.. might be impossible... since it seems to use a number of features of iOS that I do not believe Xojo directly exposes

    here is a Swift4 demo.... so I don't think it is going to be a simple "declare" or two

    //This framework contains authentication helper codes
    import LocalAuthentication
    class ViewController: UIViewController {
        @IBAction func touchIdAction(_ sender: UIButton) {
            
            print("hello there!.. You have clicked the touch ID")
            
            let myContext = LAContext()
            let myLocalizedReasonString = "Biometric Authntication testing !! "
            
            var authError: NSError?
            if #available(iOS 8.0, macOS 10.12.1, *) {
                if myContext.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &authError) {
                    myContext.evaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, localizedReason: myLocalizedReasonString) { success, evaluateError in
                        
                        DispatchQueue.main.async {
                            if success {
                                // User authenticated successfully, take appropriate action
                                self.successLabel.text = "Awesome!!... User authenticated successfully"
                            } else {
                                // User did not authenticate successfully, look at error and take appropriate action
                                self.successLabel.text = "Sorry!!... User did not authenticate successfully"
                            }
                        }
                    }
                } else {
                    // Could not evaluate policy; look at authError and present an appropriate message to user
                    successLabel.text = "Sorry!!.. Could not evaluate policy."
                }
            } else {
                // Fallback on earlier versions
                
                successLabel.text = "Ooops!!.. This feature is not supported."
            }
            
            
        }
    }

    https://medium.com/anantha-krishnan-k-g/how-to-add-faceid-touchid-using-swift-4-a220db360bf4

  3. Ulrich B

    Jan 19 Pre-Release Testers, Xojo Pro Europe (Germany, Berlin) · xo...

    Yes. Antonio has ARUnlock on sale: https://www.falcosoftware.com/xojo/

  4. Antonio R

    Jan 21 Pre-Release Testers, Xojo Pro Europe (Italy)

    Yes. Try it and contact me for a licence.

or Sign Up to reply!