LAContext policy evaluation fails with -1004 error code even with user interaction
| Originator: | patrick.hartling | ||
| Number: | rdar://26847567 | Date Originated: | June 16, 2016 |
| Status: | Closed | Resolved: | |
| Product: | iOS | Product Version: | 8.4 through 9.3.2 |
| Classification: | Reproducible: |
Duplicate of 25962752 (Open)
Area:
TouchID
Summary:
Our iOS application uses Touch ID as an alternative to typing in a PIN to unlock access to the app. Since adding this feature, we have received reports from users about the Touch ID interface not being displayed reliably. We have tried numerous things to make the display of the Touch ID interface more reliable:
1. Ensuring that a view controller is on screen before using LAContext to evaluate the LAPolicyDeviceOwnerAuthenticationWithBiometrics policy
1. Waiting on receipt of UIApplicationDidBecomeActiveNotification before using LAContext
1. Using dispatch_async() to delay the use of LAContext until the next run loop iteration after receiving UIApplicationDidBecomeActiveNotification
1. Automatically retrying invocations of -evaluatePolicy:localizedReason: when receiving the -1004 "User interaction is required" error
1. Adding a button to allow users to request Touch ID when it fails to display automatically
Nothing has fully resolved the problem so that Touch ID is displayed reliably. Even the case of user interaction through the button does not satisfy the user interaction requirement.
Steps to Reproduce:
The reproduction is unknown.
Expected Results:
When the application is in the active state with a view controller on screen, we expect that sending -evaluatePolicy:localizedReason: to an instance of LAContext will result in the Touch ID interface being displayed if the user has Touch ID enabled and configured on their iOS device.
Actual Results:
Most user reports read like this:
> Using Touch ID to unlock the app worked for a while, but then it stopped being displayed. Tapping the button to display it has no effect.
Our log files from the app show that the following error occurs in these circumstances:
Error Domain=com.apple.LocalAuthentication Code=-1004 "User interaction is required." UserInfo={NSLocalizedDescription=User interaction is required.}
Version:
iOS 8.4, iOS 9.1, iOS 9.2, iOS 9.2.1, iOS 9.3, iOS 9.3.1, iOS 9.3.2
Notes:
A reproduction has yet to be determined. When users see it, they tend to say that it stops working until they update to a newer version. Then, it works for a while until stopping again.
Configuration:
iPhone 5s, iPhone 6, iPhone 6s, iPad Air 2
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!
I think we tracked this down on our end. We were building our apps such that the linked executables for a given version all had the same embedded UUID. This was interfering with the cellular data access settings for users who had multiple deployments of our apps installed simultaneously. Once we fixed things so that all builds for a given version have a distinct UUID, the Touch ID problems went away.