Commit 588470e5 authored by Kacyn Fujii's avatar Kacyn Fujii

fallback for ios 8

parent 382cd487
......@@ -199,5 +199,6 @@ console.log("App is running in emulator", DeviceInfo.isEmulator()); // if app is
console.log("App is running on a tablet", DeviceInfo.isTablet()); // if app is running on a tablet return true
console.log("PIN or fingerprint configured on device", DeviceInfo.isPinOrFingerprintSet()); // if PIN or fingerprint is configured
console.log("PIN or fingerprint configured on device", DeviceInfo.isPinOrFingerprintSet()); // if PIN or fingerprint is configured.
// For iOS 8.0 and below, this will only return true if Touch ID is enabled
```
......@@ -166,7 +166,14 @@ RCT_EXPORT_MODULE()
- (bool) isPinOrFingerprintSet
{
LAContext *context = [[LAContext alloc] init];
return ([context canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:nil]);
// Fallback to LAPolicyDeviceOwnerAuthenticationWithBiometrics if iOS version <9.0
if ([[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion:(NSOperatingSystemVersion){9,0,0}]) {
return ([context canEvaluatePolicy:LAPolicyDeviceOwnerAuthentication error:nil]);
}
else {
return ([context canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:nil]);
}
}
- (NSDictionary *)constantsToExport
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment