Latest | 2.0.0 |
---|---|
Homepage | https://github.com/vasilenkoigor/BiometricAuth |
License | MIT |
Platforms | ios 9.3, osx 10.12.2 |
Frameworks | LocalAuthentication |
Authors |
Features
- [x] Force failure authentication if was added new fingerprint to device. This feature for security considerations.
- [x] Saving features list that’s needs authentication via TouchID
Requirements
- iOS 9.0+ / macOS 10.12+
- Xcode 8.1+
- Swift 4.0+
Communication
- If you found a bug, open an issue.
- If you have a feature request, open an issue.
- If you want to contribute, submit a pull request.
Installation
CocoaPods
CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:
$ gem install cocoapods
To integrate BiometricAuth into your Xcode project using CocoaPods, specify it in your Podfile
:
platform :ios, '9.0'
use_frameworks!
target '<Your Target Name>' do
pod 'BiometricAuth'
end
Then, run the following command:
$ pod install
Carthage
Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.
You can install Carthage with Homebrew using the following command:
$ brew update
$ brew install carthage
To integrate BiometricAuth into your Xcode project using Carthage, specify it in your Cartfile
:
github "vasilenkoigor/BiometricAuth"
Run carthage update
to build the framework and drag the built BiometricAuth.framework
into your Xcode project.
Usage
Intro
In security cosiderations strongly recommented enable forceThrowsOnChangedDomainState
let biometricAuth = BiometricAuth(forceThrowsOnChangedDomainState: true)
Biometric authentication availability
do {
try self.biometricAuth.isAvailable()
} catch let error as BiometricAuthError {
print(error.localizedDescription)
} catch {
print("Something went wrong")
}
Feature enabled/disabled for biometric authentication
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")
}
Authenticating
self.biometricAuth.requestAuthentication(forFeature: feature, reason: "Reason", completion: { (result, error) in
if result {
print("Success")
}
})
License
BiometricAuth is released under the MIT license. See LICENSE for details.
Latest podspec
{ "name": "BiometricAuth", "version": "2.0.0", "summary": "Biometric authentication (via TouchID) in your application", "description": "Framework for biometric authentication (via TouchID) in your application", "homepage": "https://github.com/vasilenkoigor/BiometricAuth", "license": { "type": "MIT", "file": "LICENSE" }, "authors": { "Igor Vasilenko": "[email protected]" }, "platforms": { "ios": "9.3", "osx": "10.12.2" }, "source": { "git": "https://github.com/vasilenkoigor/BiometricAuth.git", "tag": "2.0.0" }, "source_files": "Sources/**/*", "frameworks": "LocalAuthentication", "pushed_with_swift_version": "3.0" }
Sun, 24 Sep 2017 13:20:10 +0000