[AC-6044] Ti.Identity or Module.Identity - Cannot use Passcode or Pattern for Android
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Needs more info |
Resolution Date | 2018-12-10T22:43:33.000+0000 |
Affected Version/s | Appcelerator Studio 4.5.0 |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | Android, TiIdentity, |
Reporter | Mark Henderson |
Assignee | Shak Hossain |
Created | 2018-12-03T10:12:44.000+0000 |
Updated | 2020-03-18T16:45:21.000+0000 |
Description
I've tried to use the latest module Ti.Identity and the built into the SDK version Modules.Identity.
I have this working great for iOS, but I'm having issues with Android.
I have two Android devices, both support Fingerprint. If the Fingerprint is set then when I call .authenticate() then there is no UI like on iOS but if I successfully scan then I get a Yay Success!
If there is no Fingerprint set but there is a passcode nothing happens. Same no UI.
On Android you cannot call setAuthenticationPolicy() but you can set authenticationPolicy property.
If I set it to AUTHENTICATION_POLICY_PASSCODE. It seems like it's set but it doesn't do anything different no UI for the passcode.
See example app:
var TiIdentity = require('ti.identity');
var win = Ti.UI.createWindow();
var btn = Ti.UI.createButton({
title: 'authenticate'
});
win.add(btn);
win.open();
btn.addEventListener('click', function(){
Ti.API.info('gets here1');
if (!TiIdentity.isSupported()) {
alert("Touch ID is not supported on this device!");
return;
}
TiIdentity.authenticationPolicy = TiIdentity.AUTHENTICATION_POLICY_PASSCODE;
var deviceCanAuthenticate = TiIdentity.deviceCanAuthenticate();
if (deviceCanAuthenticate.canAuthenticate) {
TiIdentity.authenticate({
reason: 'We need your fingerprint to continue.',
callback: function(e) {
Ti.API.info('gets here1');
if (!e.success) {
alert('Message: ' + e.error);
} else {
alert('YAY! success');
}
}
});
} else {
alert('Error: ' + deviceCanAuthenticate.error);
}
});
Hi [~mark.henderson@snagr.co.uk], What version of ti SDK and identity module you're using? Can you share your device details as well? Let us know the update. Thanks!
The plan is to solve this in "ti.identity" via Google's new Biometrics APIs. This will be handle via ticket: [MOD-2588]