Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TouchID not showing on resuming app #145

Closed
sschale opened this issue Apr 15, 2016 · 10 comments
Closed

TouchID not showing on resuming app #145

sschale opened this issue Apr 15, 2016 · 10 comments

Comments

@sschale
Copy link
Contributor

sschale commented Apr 15, 2016

On devices, there's a number of times when I can pretty reliably end up with the Passcode prompt instead of TouchID.

My setup:

  1. On applicationWillResignActive I call
if self.passcodeEnteredRight {
     LTHPasscodeViewController.saveTimerDuration(60 * 5)
     LTHPasscodeViewController.saveTimerStartTime()
    }
  1. On applicationDidBecomeActive I call:
if LTHPasscodeViewController.doesPasscodeExist() {
      if LTHPasscodeViewController.didPasscodeTimerEnd() {
        //immediately clear that it was previously entered correctly
        self.passcodeEnteredRight = false
        LTHPasscodeViewController.sharedUser().showLockScreenWithAnimation(true, withLogout: false, andLogoutTitle: "ResidentAdvantage")
      }

(In didFinishLaunchingWithOptions I've tried adding LTHPasscodeViewController.sharedUser().disablePasscodeWhenApplicationEntersBackground(), which doesn't seem to change the outcome below)

  1. I run the app on my iPhone, validating with TouchID. Then if you directly lock the device, wait for the timer to end, and then unlock, I'm usually presented with the keypad to enter passcode. This also happens if you press the home button and then switch back to the app after the timer has expired.

(This is in the setting of before the patch I sent the pull request in, combined in with the other pull request, where you would never be able to get to passcode before with TouchID. I haven't had a chance to figure out the lifecycle of this issue.)

@blwinters
Copy link

@sschale I'm seeing this as well. Have you figured anything out yet?

@rolandleth
Copy link
Owner

rolandleth commented Oct 18, 2016

Does this still happen on the latest version? Some improvements have been made in the last few commits.

@sschale
Copy link
Contributor Author

sschale commented Oct 18, 2016

I'll be testing my app again soon - will update with results.

@ddaddy
Copy link
Contributor

ddaddy commented Nov 8, 2016

I'm seeing this too.
I can cold start my app and get the touchID prompt, click home button to close then reopen the app and get the touchID prompt again, if I close and reopen a second time I just get the passcode prompt.

I only get the touchID prompt back again after a cold app start.

I wonder if Apple limits how many times the touchID can be shown?

@rolandleth
Copy link
Owner

rolandleth commented Nov 18, 2016

@ddaddy How can you close the app with the TouchID alert visible? Pressing the home button with a correct finger would close the alert successfully as well, and pressing with a wrong finger doesn't take you to your homescreen.

@sschale If I call in the demo app, in the AppDelegate:

[LTHPasscodeViewController saveTimerDuration:5];

I validate with TouchID, press home, wait for the timer to finish and open the app again, I properly see the TouchID prompt. If I validate again with TouchID and lock the phone now, wait for the timer to finish and unlock the phone, I still properly see the TouchID prompt.

The idea of the timer is to use it as a configuration, set it at launch and that's it. It will automatically do what I think you're trying to accomplish: if x amount of time has passed since going to background, lock. By adding that code in applicationDidBecomeActive you're basically doing the same thing the app is already doing, which is probably why you see the passcode prompt instead of the TouchID one - by removing the code there, you'll properly see the TouchID prompt (tried it just now).

At this point, I'm not even sure why saveTimerStartTime is public, because if you do start the timer manually, say if you want to automatically lock after 5 seconds of not using the app, and the user goes into background after 4 seconds, the start time gets reset again, basically awarding 5 more seconds.

@ddaddy
Copy link
Contributor

ddaddy commented Nov 18, 2016

Sorry, I mean I open app and authorise with touchID, close and reopen and do the same, do it a third time and no touchID prompt is shown unless I force quit the app from the dock.

@rolandleth
Copy link
Owner

Sadly I don't have a device I can run the project on, so it'll have to wait until Monday.

@rolandleth
Copy link
Owner

@ddaddy Sadly, I can not reproduce. As long as the authorisation was completed successfully, the TouchID prompt appeared every time. There's another case, mentioned in issue #169, where the TouchID prompt doesn't appear anymore due to too many failed authorisations.

@rolandleth
Copy link
Owner

@sschale, @ddaddy Can you help with some more info, please? I'd have to close it otherwise, since I can't reproduce.

@rolandleth
Copy link
Owner

Can I close this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants