Open Muzietto opened 5 years ago
I have just noticed the same, yet the code in the repo seems fine
save: function(key,password, userAuthenticationRequired, successCallback, errorCallback) { exec(successCallback, errorCallback, "TouchID", "save", [key,password, userAuthenticationRequired]); },
If you use the last release version (3.2.1), just remove the "true" value after "PasswordGivenInAPasswordPrompt".
window.plugins.touchid.save( "MyAppID", "PasswordGivenInAPasswordPrompt", successCallback, errorCallback )
I think if you do this and enrolls your finger/face successfully you will always get errorCallback(message), where message equals "success".
the npm library has changed so what is userAuthenticationRequired for?
/**
* Encrypts and Saves a password under the key in the device keychain, which can be retrieved after
* successful authentication using fingerprint
* @param key {string} the key you want to store
* @param password {string} the password you want to encrypt and store
* @return {Promise<any>} Returns a promise that resolves when there is a result
*/
save(key: string, password: string, userAuthenticationRequired: boolean): Promise<any>;
the comment does not say what it is for
I am trying to use
save
on IOS.My call is:
I get systematically the error
Error in Success callback: TouchID xyz - Type Error: callback.success.call is not a function
If I remove the
true
in the third position, everything is fine.It appears that the documentation about
save
is wrong: the third boolean paramuserAuthenticationRequired
seems to be no longer in place and the two places in the docs where it is mentioned and taken as example should be amended.