Question

In: Computer Science

how can we use an existing code on our app stimulator to use face recognition on...

how can we use an existing code on our app stimulator to use face recognition on iphone app stimulator

Solutions

Expert Solution

The first step would be creating a new project under the file menu and then choose the Single View Application. Then, click on the next button.

In the next step, you need to name your project. For example, you can name it as Biometrics Authentication.

Upon the successful creation of the project, it’s time to import the Local Authentication in ViewController.swift.

One needs to go for the configuration of the Face ID privacy statement in the Info.plist file statement of the project.

This is the privacy statement, which a user sees when the app wants to take permission to use the Face ID authentication. For the addition of this privacy statement, first, choose the Info.plist file in the project navigator panel and click on the + button that is found at the bottom of the list entry.

Next is choosing the Privacy – Face ID Usage Description from the desired outcome of the previous program. Now, add the description into the desired field.

Then you need to check the biometric authentication availability first. This is applicable for both integrating the touch and face id.

Once you are confirmed, that it would support the Touch Id, you can go with the following command:

@IBAction func authenticateUser(_ sender: Any) {
// Device can use biometric authentication
     if context.canEvaluatePolicy(
        LAPolicy.deviceOwnerAuthenticationWithBiometrics,
        error: &error) {
        context.evaluatePolicy(
         .deviceOwnerAuthenticationWithBiometrics,
         localizedReason: self.strAlertMessage,
         reply: { [unowned self] (success, error) -> Void in
           DispatchQueue.main.async {
             if( success ) {
               //Fingerprint recognized
               // Do whatever action you want to perform
             } else {
                //If not recognized then
                if let error = error {
                   let strMessage = self.errorMessage(errorCode: error._code)
                   print(strMessage)
                 }
               }
             }
          })
        }
}

For face integration-
You can follow two methodologies here; the first is using the iOS devices manually where you get the biometric support. In the second process, you need to employ the simulator environment.

If you are opting for the second method to conduct the Face ID integration test, then the compilation and running the app on an iPhone X simulator becomes important.

When the app gets released, you need to choose the simulator’s hardware and then select the Face ID menu. However, it must be ensured that you have enabled the enrolled option. Now, tap on the authentication button in the app.

Related Solutions

We can remodel our existing building at a cost of $6.9 million, or build a new...
We can remodel our existing building at a cost of $6.9 million, or build a new building at a cost of $11 million. The old building, after it is refurbished, would not be as efficient as the new one, and energy costs would, therefore, be $750,000 a year higher. The maintenance cost for the old building would be $450,000 per year and $420,000 for the new building. The salvage value for the new building would be $3.25 million after its...
What are your thoughts on the topic of privilege. How can we use our privilege to...
What are your thoughts on the topic of privilege. How can we use our privilege to support cultural groups? How can we control our biases in health care and provide excellent service to our patients?
how we can strengthen the existing buildings against earthquake effects? existing old buildings
how we can strengthen the existing buildings against earthquake effects? existing old buildings
how do we use dictionaries to get json api in MIT app inventor
how do we use dictionaries to get json api in MIT app inventor
With our understanding of revenue recognition lets see how we might apply the 5 step model...
With our understanding of revenue recognition lets see how we might apply the 5 step model to the following transaction that most of us have encountered. Lets say we visit our favorite phone store and sign up for new cell service. We sign up for and receive a new phone that would normally retail for $500 (cost to manufacture $380). We commit to a three year contract where we will have to pay back an amount that starts at $600...
how can we develo our own leadership style? how can we apply it to work (whether...
how can we develo our own leadership style? how can we apply it to work (whether an organization or your own business), as well as our personal lives (the family and/or to the self)?
Suppose we have a face recognition system with an accuracy of 90%. Suppose it is deployed...
Suppose we have a face recognition system with an accuracy of 90%. Suppose it is deployed in a security system that observes 40 people. Compute the following probabilities ( You should write down the expression mathematically, and an R expression that returns the answer ): (a) It fails for exactly 6 people. (b) It fails for at most 2 people. (c) It fails for at least 8 people
Choose an app or product that you like and use a lot, describe how you can...
Choose an app or product that you like and use a lot, describe how you can redesign it and why. Make a concept paper about the product proposal comprising the following information: Introduction about your Product Product Development Product Design Product Application
How can humans face the challenge of maintaining our ecosystem so that it can sustain diverse...
How can humans face the challenge of maintaining our ecosystem so that it can sustain diverse species? What role does understanding the impact of the formation of new species and the extinction of others play in facing this challenge? What role does technology and society have in the future of our relationship with our global ecosystem?
How can humans face the challenge of maintaining our ecosystem so that it can sustain diverse...
How can humans face the challenge of maintaining our ecosystem so that it can sustain diverse species? What role does understanding the impact of the formation of new species and the extinction of others play in facing this challenge? Will humans be just another primate to go extinct?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT