Last active
December 19, 2020 12:00
-
-
Save SmartfaceDocs/a7874ecf485b3870903c to your computer and use it in GitHub Desktop.
Device fingerprint
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (Device.canEvaluateFingerPrint) { | |
// here scan fingerprint method can be called | |
} else { | |
// biometry is not available for that device | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myButton = new SMF.UI.TextButton({ | |
top : "25%", | |
left : "15%", | |
height : "10%", | |
width : "70%", | |
text : "Scan fingerPrint" | |
}); | |
myButton.onPressed = function () { | |
if (Device.canEvaluateFingerPrint) { | |
Device.scanFingerPrint({ | |
title : "myTitle", // Android only, ignored in iOS | |
subtitle : "mySubtitle", | |
icon : "myicon.png", // Android only, ignored in iOS | |
fallbackText : "Enter Password" // iOS only, ignored in Android | |
}, function onSuccess(e) { | |
// Scan is success | |
}, function onError(e) { | |
alert("code: " + e.code + | |
"\n description: " + e.description); | |
if (e.code == "-3") { // -3 is errorCode of fallback | |
// a password field can be showed to user | |
alert("Fallback called"); | |
} | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment