EddyVerbruggen / cordova-plugin-touch-id

:nail_care: 👱‍♂️ Forget passwords, use a fingerprint scanner!
MIT License
214 stars 72 forks source link

Questions about "resultWithStatus:CDVCommandStatus_***" #94

Open WuglyakBolgoink opened 4 years ago

WuglyakBolgoink commented 4 years ago

Hallo @EddyVerbruggen

I have some questions...

  1. In this case we return nothing or NULL. Correct?

    https://github.com/EddyVerbruggen/cordova-plugin-touch-id/blob/9c42bbfec35e9b0e09f043d5681b7e894279f939/src/ios/TouchID.m#L15 https://github.com/EddyVerbruggen/cordova-plugin-touch-id/blob/9c42bbfec35e9b0e09f043d5681b7e894279f939/src/ios/TouchID.m#L146


  1. Why in this case we return STRING instead of messageAsDictionary

    https://github.com/EddyVerbruggen/cordova-plugin-touch-id/blob/9c42bbfec35e9b0e09f043d5681b7e894279f939/src/ios/TouchID.m#L50 https://github.com/EddyVerbruggen/cordova-plugin-touch-id/blob/9c42bbfec35e9b0e09f043d5681b7e894279f939/src/ios/TouchID.m#L156


  1. didFingerprintDatabaseChange has CDVCommandStatus_ERROR, which not described in README...

    https://github.com/EddyVerbruggen/cordova-plugin-touch-id/blob/9c42bbfec35e9b0e09f043d5681b7e894279f939/src/ios/TouchID.m#L50

// we expect the dev to have checked 'isAvailable' already so this should not return an error, // we do however need to run canEvaluatePolicy here in order to get a non-nil evaluatedPolicyDomainState

it's mean, that we should always wrap didFingerprintDatabaseChange with isAvailable and in this case this CDVCommandStatus_ERROR never happens?!