0

I have successfully added Biometrics to my app, so that users can use Touch ID / Face ID to unlock and use the app.

Right now, I want to implement immediate lock once user leaves the application (applicationWillResignActive), and thus requires Biometrics check when becoming active (applicationDidBecomeActive).

Question:

How can I skip the authentication only if the app is temporarily interrupted?

Harry Ng
  • 1,070
  • 8
  • 20

1 Answers1

0

Way-1: You can achieve such implementation using Timer. When user goes in background, then just enable background timer.

After short of time, when user back to use app at that time invalidate background timer and check for duration. If that duration is larger than defined time duration than display authentication popup otherwise it is not required.

Way-2: We can also achieving same result by storing Date in variable while user goes in back ground & while back to use app, Compare that stored date with current date. With that result we can able to decide whether we have to display authentication context or not.

Sagar Thummar
  • 2,034
  • 15
  • 21