BiometricAuth 2.0.0

BiometricAuth 2.0.0

测试已测试
语言语言 SwiftSwift
许可证 MIT
发布上次发布2017年9月
SwiftSwift版本3.0
SPM支持SPM

Igor Vasilenko维护。



  • Igor Vasilenko

特性

  • [x] 如果设备中添加了新的指纹,则强制失败认证。此功能出于安全考虑。
  • [x] 存储需要通过 TouchID 进行认证的特性列表

要求

  • iOS 9.0+ / macOS 10.12+
  • Xcode 8.1+
  • Swift 4.0+

通信

  • 如果您找到了 一个错误,请提交问题。
  • 如果您 有功能请求,请提交问题。
  • 如果您 想要贡献,提交拉取请求。

使用

简介

在安全考虑方面,强烈建议启用 forceThrowsOnChangedDomainState

let biometricAuth = BiometricAuth(forceThrowsOnChangedDomainState: true)

生物认证可用性

do {
    try self.biometricAuth.isAvailable()
} catch let error as BiometricAuthError {
    print(error.localizedDescription)
} catch {
    print("Something went wrong")
}

启用/禁用生物认证特性

let feature = "Passcode Screen Auth"

do {
    try self.biometricAuth.enableAuthentication(forFeature: feature)
} catch let error as BiometricAuthError {
    print(error.localizedDescription)
} catch {
    print("Something went wrong")
}

认证

self.biometricAuth.requestAuthentication(forFeature: feature, reason: "Reason", completion: { (result, error) in
    if result {
        print("Success")
    }
})

许可证

BiometricAuth 在 MIT 许可下发布。有关详细信息,请参阅 LICENSE。