Latest 0.1.0
Homepage https://github.com/mshibanami/BiometryTypeBugWorkaround
License MIT
Platforms ios 11.0
Authors

CI Status
Version
License
Platform

LAContext of LocalAuthentication framework has a property called biometryType.
It has a type of biometric authentication supported by the device.
It is supporsed to be set after called LAContext‘s canEvaluatePolicy(_:error:).
But in some cases, it isn’t set. It’s a bug of iOS 11.0.x.

This library provides a workaround for the bug.

What is "a bug of iOS 11.0.x" ?

See more details: http://www.openradar.me/radar?id=5061720007507968

Usage

This library has just 1 method as LAContext‘s extension.
biometryTypeForWorkaround(with:).
It is a replacement of LAContext‘s biometryType property. You can use it like this:

let context = LAContext()
var error: NSError?
let canEvaluate = context.canEvaluatePolicy(
    .deviceOwnerAuthenticationWithBiometrics,
    error: &error)

let biometryType = context.biometryTypeForWorkaround(
    with: error as? LAError)

the method needs

Caution

This library is unnecessary if your app’s minimum deployment target is iOS 11.1 or later.
This library is for the bug of iOS 11.0.x.

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

BiometryTypeBugWorkaround is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'BiometryTypeBugWorkaround'

Author

Manabu Nakazawa (@mshibanami)

License

BiometryTypeBugWorkaround is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "BiometryTypeBugWorkaround",
    "version": "0.1.0",
    "summary": "A workaround for iOS 11's bug about LAContext.biometryType.",
    "description": "`LAContext` of `LocalAuthentication` framework has a property called `biometryType`.nIt has a type of biometric authentication supported by the device.nIt is supporsed to be set after called `LAContext`'s `canEvaluatePolicy(_:error:)`.nBut in some cases, it isn't set. It's a bug of iOS 11.0.x.n(See more details: http://www.openradar.me/radar?id=5061720007507968)nThis library provides a workaround for the bug.",
    "homepage": "https://github.com/mshibanami/BiometryTypeBugWorkaround",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Manabu Nakazawa": "[email protected]"
    },
    "source": {
        "git": "https://github.com/mshibanami/BiometryTypeBugWorkaround.git",
        "tag": "0.1.0"
    },
    "social_media_url": "https://twitter.com/mshibanami",
    "platforms": {
        "ios": "11.0"
    },
    "source_files": "BiometryTypeBugWorkaround/Classes/**/*",
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This