I'm having some issues understanding the return values I'm getting even with a fresh project with only the below code.
- (void)viewDidLoad {
[super viewDidLoad];
LAContext* touchContext = [LAContext new];
NSError* policyEvaluationError = nil;
[touchContext canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics
error:&policyEvaluationError];
NSLog(@"\n\n %@", policyEvaluationError);
}
These are the results on just iPad simulators, iOS 10.3.1 - 11.3.
iPad (5th Generation) - "Biometry is not available on this device."
iPad Air - "Biometry is not available on this device."
iPad Air 2 - “No identities are enrolled."
iPad Pro (9.7-inch) - "Biometry is not available on this device."
iPad Pro (12.9-inch) (2nd generation) - "Biometry is not available on this device."
These results of "Biometry is not available on this device." happen when these devices are enrolled or not.
All iPhone device types tested also return "No identities are enrolled." like iPad Air 2, which I would expect when they are not enrolled but possess touchID hardware. When enrolled, there simply is no error.
On some actual iPad devices, the results seem to vary as well, but not in the same way. Without fingerprints stored, some devices return "Biometry is not available on this device." while others simply return the enrolled/nil. With fingerprints stored, they all seem to behave as I would expect.
As far as I'm aware, we've been using this code in production for quite some time without complaints related to this topic, but we've only recently noticed it within development/QA.
Is this code just not reliable across all devices, has something changed possibly, or am I doing something wrong here?