diff --git a/README.md b/README.md new file mode 100644 index 0000000..82afadb --- /dev/null +++ b/README.md @@ -0,0 +1,123 @@ + +
+ + + +
+ + + +[![](https://jitpack.io/v/AlexJuca/BiometrickKit.svg)](https://jitpack.io/#AlexJuca/Kiyo) + +BiometricKit is a simple to use and android fingerprint authentication Library written in pure kotlin for Android M (API 23) and above that follows the material design guidelines. Guidelines + + + +Download +-------- + +Download the latest version via Gradle: + +**Step 1:** Include jitpack to your projects build.gradle file +``` +allprojects { + repositories { + ... + maven { url 'https://jitpack.io' } + } +} +``` + +**Step 2:** Add the Kiyo dependency to your build.gradle file + +``` +dependencies +{ + implementation 'com.github.AlexJuca:Biometrickit:0.0.1' +} +``` + + +Usage +---------- + +**Step 1:** Set up a BiometricKitCallback to handle callbacks. +```java + +private val biometricKitCallback: BiometricKitCallback = object: BiometricKitCallback { + override fun onSdkVersionNotSupported() { + + } + + override fun onBiometricAuthenticationNotSupported() { + + } + + override fun onBiometricAuthenticationNotAvailable() { + + } + + override fun onBiometricAuthenticationPermissionNotGranted() { + + } + + override fun onBiometricAuthenticationInternalError(error: String) { + + } + + override fun onAuthenticationFailed() { + + } + + override fun onAuthenticationCancelled() { + prompt.authenticate(this, false) + } + + override fun onAuthenticationSuccessful() { + Toast.makeText(this@MainActivity, "Bought successfully", Toast.LENGTH_SHORT).show() + } + + override fun onAuthenticationHelp(helpCode: Int, helpString: CharSequence?) { + + } + + override fun onAuthenticationError(errorCode: Int, errString: CharSequence?) { + + } + + } +``` + +**Step 2:** + +```java + val prompt = BiometricKit.BiometricBuilder(this as Context) + .setTitle("Confirm Payment") + .setSubtitle("corextechnologies@gmail.com") + .setDescription("Paying for Kamba Gas Service") + .setNegativeButtonText("Cancel").setInstructions("Touch the fingerprint sensor") + .build() + + prompt.authenticate(biometricKitCallback, true) +``` + +## Version history +``` 0.0.1: Initial Version - 28/03/2019 ```