[MOD-2356] iOS: Ti.TouchID - Expose "keepAlive" property to properly manage auth-contextlifetime
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-11-10T19:26:34.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 7.0.0, Ti.TouchID 2.1.5 |
Components | TouchID |
Labels | n/a |
Reporter | Hans Knöchel |
Assignee | Hans Knöchel |
Created | 2017-08-31T14:00:54.000+0000 |
Updated | 2017-11-16T02:48:16.000+0000 |
Description
As a follow-up of TIMOB-25181, we should expose thekeepAlive
boolean-property, so iOS devices (especially iOS 8) can terminate the current auth-context properly.
Comments
- Hans Knöchel 2017-08-31
PR: https://github.com/appcelerator-modules/ti.touchid/pull/34
Test-case 1/3:
Test-case (2/3):var TouchID = require("ti.touchid"); var win = Ti.UI.createWindow({ backgroundColor: '#fff' }); var btn = Ti.UI.createButton({ title: 'Trigger' }); TouchID.setAuthenticationPolicy(TouchID.AUTHENTICATION_POLICY_PASSCODE); btn.addEventListener('click', function() { TouchID.authenticate({ reason: 'Can we?', keepAlive: false, callback: function(e) { console.log(e); } }); }); win.add(btn); win.open();
Test-case (3/3):var TouchID = require("ti.touchid"); var win = Ti.UI.createWindow({ backgroundColor: '#fff' }); var btn = Ti.UI.createButton({ title: 'Trigger' }); TouchID.setAuthenticationPolicy(TouchID.AUTHENTICATION_POLICY_PASSCODE); btn.addEventListener('click', function() { TouchID.authenticate({ reason: 'Can we?', callback: function(e) { console.log(e); } }); }); win.add(btn); win.open();
Expected behaviors: - 1) Auth-text get's invalidated, the prompt is shown every time - 2) Auth-text is kept alive, the prompt is shown until invalidated by the system - 3) Auth-text get's invalidated by callingvar TouchID = require("ti.touchid"); var win = Ti.UI.createWindow({ backgroundColor: '#fff' }); var btn = Ti.UI.createButton({ title: 'Trigger' }); TouchID.setAuthenticationPolicy(TouchID.AUTHENTICATION_POLICY_PASSCODE); btn.addEventListener('click', function() { TouchID.authenticate({ reason: 'Can we?', callback: function(e) { console.log(e); TouchID.invalidate(); } }); }); win.add(btn); win.open();
invalidate()
, the prompt is shown every time - Abir Mukherjee 2017-11-10 Passed FR and merged.