LAContext has method to check if device can evaluate touch ID and gives error message. Problem is that same error message \"LAErrorPasscodeNotSet\" is given by system in two cas
Maybe you could write your own method to check which device are you running on, because if returned error is the same, it would be hard to figure out exactly if Touch ID is supported. I would go with something like this:
int sysctlbyname(const char *, void *, size_t *, void *, size_t);
- (NSString *)getSysInfoByName:(char *)typeSpecifier
{
size_t size;
sysctlbyname(typeSpecifier, NULL, &size, NULL, 0);
char *answer = malloc(size);
sysctlbyname(typeSpecifier, answer, &size, NULL, 0);
NSString *results = [NSString stringWithCString:answer encoding: NSUTF8StringEncoding];
free(answer);
return results;
}
- (NSString *)modelIdentifier
{
return [self getSysInfoByName:"hw.machine"];
}
After having the model identifier, I would just check if model identifier equals is one of the models that support Touch ID:
- (BOOL)hasTouchID
{
NSArray *touchIDModels = @[ @"iPhone6,1", @"iPhone6,2", @"iPhone7,1", @"iPhone7,2", @"iPad5,3", @"iPad5,4", @"iPad4,7", @"iPad4,8", @"iPad4,9" ];
NSString *model = [self modelIdentifier];
return [touchIDModels containsObject:model];
}
The array contains all model ID's which support Touch ID, which are:
The only downside of this method is that once new devices are released with Touch ID, the model array will have to be updated manually.