mjwheatley / cordova-plugin-android-fingerprint-auth

A cordova plugin for fingerprint authentication using the hardware fingerprint scanner on devices running Android 6+
Apache License 2.0
168 stars 131 forks source link

Getting "CLASS NOT FOUND" on isAvailable() function #49

Closed PremkumarAgrawal closed 7 years ago

PremkumarAgrawal commented 7 years ago

I am using following code,

FingerprintAuth.isAvailable(function(result) { if (result.isAvailable) { if(result.hasEnrolledFingerprints){ FingerprintAuth.show({ clientId: client_id, clientSecret: client_secret }, function (result) { if (result.withFingerprint) { alert("Successfully authenticated using a fingerprint"); } else if (result.withPassword) { alert("Authenticated with backup password"); } }, function(error) { alert("ERROR : " + error); console.log(error); // "Fingerprint authentication not available" }); }else{ alert("Fingerprint auth available, but no fingerprint registered on the device"); } } }, function(message) { alert("Cannot detect fingerprint device : "+ message); });

mjwheatley commented 7 years ago

That would mean the plugin is not installed correctly. The plugin files must not have been copied into your project correctly. Please try to reinstall the plugin. The code you provide is also for a previous version of the plugin. Please install the latest version of the plugin and refer to the README and changelog for changes to the API.

PremkumarAgrawal commented 7 years ago

Hey @mjwheatley I have added following plugins please see,

F:\A_LHS_Projects\DynamicApp\DA_Team_Code\Kirti\20170123\DynamicApp_V3>ionic plugin -l (node:4692) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version. com.maginsoft.mfilechooser 1.0.0 "Maginsoft FileChooser" com.phonegap.plugins.nativesettingsopener 1.2 "Native settings" com.telerik.plugins.nativepagetransitions 0.6.5 "Native Page Transitions" com.ubookr.plugins.calllog 2.0 "CallLog" cordova-plugin-android-fingerprint-auth 1.2.5 "FingerprintAuth" cordova-plugin-android-permissions 0.10.0 "Permissions" cordova-plugin-app-event 1.2.0 "Application Events" cordova-plugin-badge 0.7.4 "Badges" cordova-plugin-camera 2.2.0 "Camera" cordova-plugin-compat 1.0.0 "Compat" cordova-plugin-console 1.0.3 "Console" cordova-plugin-contacts 2.2.0 "Contacts" cordova-plugin-datepicker 0.9.2 "DatePicker" cordova-plugin-device 1.1.2 "Device" cordova-plugin-dialogs 1.2.1 "Notification" cordova-plugin-file 4.3.1 "File" cordova-plugin-geolocation 2.2.0 "Geolocation" cordova-plugin-inappbrowser 1.5.0 "InAppBrowser" cordova-plugin-media 2.4.1 "Media" cordova-plugin-media-capture 1.4.1 "Capture" cordova-plugin-network-information 1.2.1 "Network Information" cordova-plugin-screen-orientation 1.4.2 "Screen Orientation" cordova-plugin-sim 1.3.2 "SIM" cordova-plugin-splashscreen 3.2.2 "Splashscreen" cordova-plugin-statusbar 2.1.3 "StatusBar" cordova-plugin-touchid 0.4.0 "Touch ID" cordova-plugin-tts 0.2.3 "TTS" cordova-plugin-whitelist 1.2.2 "Whitelist" cordova-plugin-x-socialsharing 5.1.1 "SocialSharing" cordova-plugin-x-toast 2.5.1 "Toast" cordova.plugins.diagnostic.api-22 2.3.10-api-22 "Diagnostic" ionic-plugin-keyboard 2.1.0 "Keyboard" org.apache.cordova.speech.speechrecognition 0.1.1 "SpeechRecognition" phonegap-plugin-barcodescanner 4.0.1 "BarcodeScanner"

mjwheatley commented 7 years ago

Are you waiting for deviceready?

PremkumarAgrawal commented 7 years ago

Yaa I am calling it on deviceready like this

` document.addEventListener('deviceready', function () {

  $scope.authenticat= function () {

    var client_id = "A";
    var client_secret = "A";

    FingerprintAuth.isAvailable(function(result) {
      if (result.isAvailable) {
        if(result.hasEnrolledFingerprints){
          FingerprintAuth.show({
              clientId: client_id,
              clientSecret: client_secret
          }, function (result) {`
PremkumarAgrawal commented 7 years ago

One more thing, is it to add FingerprintAuth.js in index.html

mjwheatley commented 7 years ago

Make sure all the files from plugin.xml have been copied to the appropriate location in your app.