Skip to content

Conversation

@m1ga
Copy link
Contributor

@m1ga m1ga commented Oct 7, 2022

Resolves #301

Sets a hint to the system for whether to require user confirmation after authentication. For example, implicit modalities like face and iris are passive, meaning they don't require an explicit user action to complete authentication.

  • the tests are broken: Android won't find the emulator (known issue with the action) and iOS has issues with the karma. That's why I removed them for now
var win = Ti.UI.createWindow();
var TiIdentity = require('ti.identity');
TiIdentity.authenticationPolicy = TiIdentity.AUTHENTICATION_POLICY_BIOMETRICS;

var supported = TiIdentity.isSupported();
console.log("is supported: ", supported);

console.log("hasFingerprintScanner: ", TiIdentity.hasFingerprintScanner);
console.log("hasFaceScanner: ", TiIdentity.hasFaceScanner);
console.log("hasIrisScanner: ", TiIdentity.hasIrisScanner);

if (TiIdentity.authenticationPolicy === TiIdentity.AUTHENTICATION_POLICY_BIOMETRICS) {
		authPhrase = 'Touch ID';
} else if (TiIdentity.authenticationPolicy === TiIdentity.AUTHENTICATION_POLICY_PASSCODE) {
	authPhrase = 'Device Passcode';
}
Ti.API.info("AUTPHRASE: " + authPhrase);


function onOpen(e) {
	if (!supported) {
		alert('Authentication is not supported on this device!');
		return;
	}
	TiIdentity.authenticate({
		reason: 'Can we access this content?',
		callback: function(e) {
			Ti.API.info(e);
		}
	});
}

win.addEventListener("open", onOpen)
win.open();

ti.identity-android-3.2.0.zip

@m1ga m1ga changed the title fix(android) null check feat(android) null check and new check properties Feb 7, 2023
@m1ga
Copy link
Contributor Author

m1ga commented Feb 7, 2023

a bit confused why I have to add the github actions again 🤔 but it thinks the master has the old actions 🤷

@jordanbisato
Copy link

After using this version, i didn't get the #301 error anymore.

@hansemannn hansemannn merged commit 83431fe into master Sep 10, 2025
8 checks passed
@hansemannn hansemannn deleted the nullCheck branch September 10, 2025 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error: CryptoObject cannot be null

4 participants