Titanium JIRA Archive
Appcelerator Community (AC)

[AC-6044] Ti.Identity or Module.Identity - Cannot use Passcode or Pattern for Android

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionNeeds more info
Resolution Date2018-12-10T22:43:33.000+0000
Affected Version/sAppcelerator Studio 4.5.0
Fix Version/sn/a
ComponentsTitanium SDK & CLI
LabelsAndroid, TiIdentity,
ReporterMark Henderson
AssigneeShak Hossain
Created2018-12-03T10:12:44.000+0000
Updated2020-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);
	}
});

Comments

  1. Jebun Naher 2018-12-04

    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!
  2. Joshua Quick 2020-03-18

    The plan is to solve this in "ti.identity" via Google's new Biometrics APIs. This will be handle via ticket: [MOD-2588]

JSON Source