Skip to content

Instantly share code, notes, and snippets.

@adrianhall
Created September 26, 2018 23:02
Show Gist options
  • Save adrianhall/a48253257732664cf9ab90003d4be9d1 to your computer and use it in GitHub Desktop.
Save adrianhall/a48253257732664cf9ab90003d4be9d1 to your computer and use it in GitHub Desktop.
// Ask for permission to use the fingerprint scanner
if (fingerprintManager.isHardwareDetected) {
if (checkSelfPermission(Manifest.permission.USE_FINGERPRINT) != PackageManager.PERMISSION_GRANTED) {
if (checkedPermissions) {
hasPermissions = false
} else {
requestPermissions(arrayOf(Manifest.permission.USE_FINGERPRINT), REQUEST_PERMISSIONS_FINGERPRINT)
}
} else {
hasPermissions = true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment