Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Missing required parameters" when trying to show the Fingerprint dialog on Android #213

Closed
engmsaleh opened this issue Dec 16, 2019 · 9 comments
Labels

Comments

@engmsaleh
Copy link

Bug report

I'm getting Missing required parameters when I'm trying to show the Fingerprint dialog on Android

Description

Here is the snippet of the code that I'm using

this.fingerprintAuth.isAvailable().then(result => {
      if (result === "finger" || result === "face") {
        //Fingerprint or Face Auth is available
        this.fingerprintAuth
          .show({
            title:"title",
            disableBackup: true //Only for Android(optional)
          })
          .then((result: any) => {
            console.log(result);
            if (result == "Success") {
              //Fingerprint/Face was successfully verified
              console.log("Success");
            } else {
              //Fingerprint/Face was not successfully verified
              // this.utility.presentAlert(result);
              console.log("error");
            }
          })
          .catch((error: any) => {
            console.log(error);
            //Fingerprint/Face was not successfully verified
            // this.utility.presentAlert(error);
          });
      } else {
        //Fingerprint or Face Auth is not available
        // this.utility.presentAlert(
        //   "Fingerprint/Face Auth is not available   on this device!"
        // );
      }
    });
  • What did you do?
    I have integrated the plugin and I'm trying to show the fingerprint dialog

  • What did happen?
    It always gives error on catch block with error Missing required parameters

  • What did you expect to happen?
    The flow should open up and work normally

Environment

  • Plugin version
 "cordova-plugin-fingerprint-aio": {
      "version": "git+https://github.com/NiklasMerz/cordova-plugin-fingerprint-aio.git#67e877dac283d3c7f1a1eb870855cdb258999507",
      "from": "git+https://github.com/NiklasMerz/cordova-plugin-fingerprint-aio.git",
      "requires": {
        "cordova-plugin-add-swift-support": "^2.0.2"
      }
    }
  • Build environment (cordova info)
[email protected] with:
  [email protected]
  [email protected]
  [email protected]
  [email protected]

Environment: 
  OS: darwin
  Node: v10.16.3
  npm: 6.13.3

Plugins:
  cordova-plugin-add-swift-support
  cordova-plugin-device
  cordova-plugin-dialogs
  cordova-plugin-fingerprint-aio
  cordova-plugin-globalization
  cordova-plugin-inappbrowser
  cordova-plugin-ionic-keyboard
  cordova-plugin-ionic-webview
  cordova-plugin-mfp
  cordova-plugin-nativestorage
  cordova-plugin-okhttp
  cordova-plugin-splashscreen
  cordova-plugin-statusbar
  cordova-plugin-whitelist
  cordova-sqlite-storage

Android platform:
  ERROR: android: Command failed with exit code ENOENT



iOS platform:
  Xcode 11.3
  Build version 11C29

config.xml <<EOF
<?xml version='1.0' encoding='utf-8'?>
<widget android-versionCode="1000100" id="com.Taleem" version="1.0.32" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" xmlns:mfp="http://www.ibm.com/mobilefirst/cordova-plugin-mfp">
    <name>Taaleem</name>
    <description>Taaleem app</description>
    <author email="[email protected]" href="http://ionicframework.com/">Ionic Framework Team</author>
    <content src="index.html" />
    <access origin="*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <preference name="orientation" value="portrait" />
    <preference name="ScrollEnabled" value="false" />
    <preference name="StatusBarOverlaysWebView" value="true" />
    <preference name="StatusBarStyle" value="lightcontent" />
    <preference name="android-minSdkVersion" value="23" />
    <preference name="BackupWebStorage" value="none" />
    <preference name="SplashMaintainAspectRatio" value="true" />
    <preference name="SplashShowOnlyFirstTime" value="false" />
    <preference name="SplashScreen" value="screen" />
    <preference name="FadeSplashScreen" value="false" />
    <preference name="FadeSplashScreenDuration" value="300" />
    <preference name="AutoHideSplashScreen" value="false" />
    <preference name="UseSwiftLanguageVersion" value="4.0" />
    <platform name="android">
        <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">
            <application android:networkSecurityConfig="@xml/network_security_config" />
        </edit-config>
        <resource-file src="resources/android/xml/network_security_config.xml" target="app/src/main/res/xml/network_security_config.xml" />
        <allow-intent href="market:*" />
        <icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
        <icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
        <icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" />
        <icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" />
        <icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" />
        <icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" />
        <splash density="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.png" />
        <splash density="land-mdpi" src="resources/android/splash/drawable-land-mdpi-screen.png" />
        <splash density="land-hdpi" src="resources/android/splash/drawable-land-hdpi-screen.png" />
        <splash density="land-xhdpi" src="resources/android/splash/drawable-land-xhdpi-screen.png" />
        <splash density="land-xxhdpi" src="resources/android/splash/drawable-land-xxhdpi-screen.png" />
        <splash density="land-xxxhdpi" src="resources/android/splash/drawable-land-xxxhdpi-screen.png" />
        <splash density="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png" />
        <splash density="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png" />
        <splash density="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png" />
        <splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" />
        <splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" />
        <splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" />
    </platform>
    <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
        <icon height="57" src="resources/ios/icon/icon.png" width="57" />
        <icon height="114" src="resources/ios/icon/[email protected]" width="114" />
        <icon height="29" src="resources/ios/icon/icon-small.png" width="29" />
        <icon height="58" src="resources/ios/icon/[email protected]" width="58" />
        <icon height="87" src="resources/ios/icon/[email protected]" width="87" />
        <icon height="20" src="resources/ios/icon/icon-20.png" width="20" />
        <icon height="40" src="resources/ios/icon/[email protected]" width="40" />
        <icon height="60" src="resources/ios/icon/[email protected]" width="60" />
        <icon height="48" src="resources/ios/icon/[email protected]" width="48" />
        <icon height="55" src="resources/ios/icon/[email protected]" width="55" />
        <icon height="29" src="resources/ios/icon/icon-29.png" width="29" />
        <icon height="58" src="resources/ios/icon/[email protected]" width="58" />
        <icon height="87" src="resources/ios/icon/[email protected]" width="87" />
        <icon height="40" src="resources/ios/icon/icon-40.png" width="40" />
        <icon height="80" src="resources/ios/icon/[email protected]" width="80" />
        <icon height="120" src="resources/ios/icon/[email protected]" width="120" />
        <icon height="88" src="resources/ios/icon/[email protected]" width="88" />
        <icon height="50" src="resources/ios/icon/icon-50.png" width="50" />
        <icon height="100" src="resources/ios/icon/[email protected]" width="100" />
        <icon height="60" src="resources/ios/icon/icon-60.png" width="60" />
        <icon height="120" src="resources/ios/icon/[email protected]" width="120" />
        <icon height="180" src="resources/ios/icon/[email protected]" width="180" />
        <icon height="72" src="resources/ios/icon/icon-72.png" width="72" />
        <icon height="144" src="resources/ios/icon/[email protected]" width="144" />
        <icon height="76" src="resources/ios/icon/icon-76.png" width="76" />
        <icon height="152" src="resources/ios/icon/[email protected]" width="152" />
        <icon height="167" src="resources/ios/icon/[email protected]" width="167" />
        <icon height="172" src="resources/ios/icon/[email protected]" width="172" />
        <icon height="196" src="resources/ios/icon/[email protected]" width="196" />
        <icon height="1024" src="resources/ios/icon/icon-1024.png" width="1024" />
        <splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" />
        <splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640" />
        <splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" width="768" />
        <splash height="768" src="resources/ios/splash/Default-Landscape~ipad.png" width="1024" />
        <splash height="1125" src="resources/ios/splash/Default-Landscape-2436h.png" width="2436" />
        <splash height="1242" src="resources/ios/splash/Default-Landscape-736h.png" width="2208" />
        <splash height="2048" src="resources/ios/splash/Default-Portrait@2x~ipad.png" width="1536" />
        <splash height="1536" src="resources/ios/splash/Default-Landscape@2x~ipad.png" width="2048" />
        <splash height="2732" src="resources/ios/splash/Default-Portrait@~ipadpro.png" width="2048" />
        <splash height="2048" src="resources/ios/splash/Default-Landscape@~ipadpro.png" width="2732" />
        <splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" />
        <splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" />
        <splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242" />
        <splash height="2436" src="resources/ios/splash/Default-2436h.png" width="1125" />
        <splash height="2732" src="resources/ios/splash/Default@2x~universal~anyany.png" width="2732" />
    </platform>
    <allow-navigation href="http://192.168.1.116:8100" sessionid="9c353984" />
    <mfp:android>
        <mfp:sdkChecksum>2405394652</mfp:sdkChecksum>
        <mfp:appChecksum>0</mfp:appChecksum>
        <mfp:security>
            <mfp:testWebResourcesChecksum enabled="false" ignoreFileExtensions="png, jpg, jpeg, gif, mp4, mp3" />
        </mfp:security>
    </mfp:android>
    <mfp:ios>
        <mfp:sdkChecksum>336151202</mfp:sdkChecksum>
        <mfp:appChecksum>0</mfp:appChecksum>
        <mfp:security>
            <mfp:testWebResourcesChecksum enabled="false" ignoreFileExtensions="png, jpg, jpeg, gif, mp4, mp3" />
        </mfp:security>
    </mfp:ios>
    <mfp:windows>
        <mfp:windows8>
            <mfp:sdkChecksum>0</mfp:sdkChecksum>
            <mfp:security>
                <mfp:testWebResourcesChecksum enabled="false" ignoreFileExtensions="png, jpg, jpeg, gif, mp4, mp3" />
            </mfp:security>
        </mfp:windows8>
        <mfp:windowsphone8>
            <mfp:sdkChecksum>0</mfp:sdkChecksum>
            <mfp:security>
                <mfp:testWebResourcesChecksum enabled="false" ignoreFileExtensions="png, jpg, jpeg, gif, mp4, mp3" />
            </mfp:security>
        </mfp:windowsphone8>
        <mfp:windows10>
            <mfp:sdkChecksum>0</mfp:sdkChecksum>
            <mfp:security>
                <mfp:testWebResourcesChecksum enabled="false" ignoreFileExtensions="png, jpg, jpeg, gif, mp4, mp3" />
            </mfp:security>
        </mfp:windows10>
        <mfp:appChecksum>0</mfp:appChecksum>
    </mfp:windows>
    <mfp:platformVersion>8.0.0.00-20190910-142437</mfp:platformVersion>
    <mfp:clientCustomInit enabled="false" />
    <mfp:server runtime="gbm" url="http://ec2-3-133-94-50.us-east-2.compute.amazonaws.com:9080" />
    <mfp:serverUri url="" />
    <mfp:directUpdateAuthenticityPublicKey />
    <mfp:languagePreferences>en</mfp:languagePreferences>
    <mfp:APIproxyURL>/adapters/MobileAPIProxy</mfp:APIproxyURL>
    <engine name="browser" spec="6.0.0" />
    <engine name="ios" spec="^5.1.0" />
    <plugin name="cordova-plugin-whitelist" spec="1.3.3" />
    <plugin name="cordova-plugin-statusbar" spec="2.4.2" />
    <plugin name="cordova-plugin-device" spec="2.0.2" />
    <plugin name="cordova-plugin-splashscreen" spec="5.0.2" />
    <plugin name="cordova-plugin-ionic-webview" spec="^4.0.0">
        <variable name="ANDROID_SUPPORT_ANNOTATIONS_VERSION" value="27.+" />
    </plugin>
    <plugin name="cordova-plugin-ionic-keyboard" spec="^2.0.5" />
    <plugin name="cordova-plugin-inappbrowser" spec="^3.1.0" />
    <plugin name="cordova-plugin-mfp" spec="^8.0.2019091217" />
    <plugin name="cordova-sqlite-storage" />
</widget>

EOF

package.json <<EOF
{
  "name": "moe",
  "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "https://ionicframework.com/",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/common": "~8.1.2",
    "@angular/compiler": "~8.1.2",
    "@angular/core": "~8.1.2",
    "@angular/forms": "~8.1.2",
    "@angular/platform-browser": "~8.1.2",
    "@angular/platform-browser-dynamic": "~8.1.2",
    "@angular/router": "~8.1.2",
    "@ionic-native/core": "^5.0.0",
    "@ionic-native/fingerprint-aio": "^5.18.0",
    "@ionic-native/in-app-browser": "^5.15.1",
    "@ionic-native/splash-screen": "^5.0.0",
    "@ionic-native/status-bar": "^5.0.0",
    "@ionic/angular": "^4.7.1",
    "@ionic/storage": "^2.2.0",
    "@ngx-translate/core": "^11.0.1",
    "@ngx-translate/http-loader": "^4.0.0",
    "cordova-android": "^8.1.0",
    "cordova-browser": "6.0.0",
    "cordova-ios": "^5.1.0",
    "cordova-plugin-device": "2.0.2",
    "cordova-plugin-dialogs": "^2.0.2",
    "cordova-plugin-fingerprint-aio": "git+https://github.com/NiklasMerz/cordova-plugin-fingerprint-aio.git",
    "cordova-plugin-globalization": "^1.11.0",
    "cordova-plugin-inappbrowser": "^3.1.0",
    "cordova-plugin-ionic-keyboard": "^2.0.5",
    "cordova-plugin-ionic-webview": "^4.0.0",
    "cordova-plugin-mfp": "^8.0.2019091217",
    "cordova-plugin-okhttp": "^2.0.0",
    "cordova-plugin-splashscreen": "5.0.2",
    "cordova-plugin-statusbar": "2.4.2",
    "cordova-plugin-whitelist": "1.3.3",
    "core-js": "^2.5.4",
    "ibm-mfp-web-sdk": "^8.0.2019070909",
    "ionic2-calendar": "^0.5.6",
    "jsencrypt": "^3.0.0-rc.1",
    "ng-circle-progress": "^1.5.1",
    "rxjs": "~6.5.1",
    "scalts": "^1.1.0",
    "scalts-array": "^0.7.0",
    "sw-toolbox": "^3.6.0",
    "ts-json-definition": "0.0.3",
    "ts-md5": "^1.2.7",
    "ts-serialize": "^1.3.2",
    "tslib": "^1.9.0",
    "zone.js": "~0.9.1"
  },
  "devDependencies": {
    "@angular-devkit/architect": "~0.801.2",
    "@angular-devkit/build-angular": "~0.801.2",
    "@angular-devkit/core": "~8.1.2",
    "@angular-devkit/schematics": "~8.1.2",
    "@angular/cli": "~8.1.2",
    "@angular/compiler": "~8.1.2",
    "@angular/compiler-cli": "~8.1.2",
    "@angular/language-service": "~8.1.2",
    "@ionic/angular-toolkit": "~2.0.0",
    "@ionic/lab": "2.0.13",
    "@types/jasmine": "~3.3.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~8.9.4",
    "codelyzer": "^5.0.0",
    "cordova-plugin-device": "^2.0.3",
    "cordova-plugin-ionic-keyboard": "^2.2.0",
    "cordova-plugin-ionic-webview": "^4.1.3",
    "cordova-plugin-splashscreen": "^5.0.2",
    "cordova-plugin-statusbar": "^2.4.2",
    "cordova-plugin-whitelist": "^1.3.3",
    "jasmine-core": "~3.4.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.1.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~2.0.1",
    "karma-jasmine-html-reporter": "^1.4.0",
    "protractor": "~5.4.0",
    "ts-node": "~7.0.0",
    "tslint": "~5.15.0",
    "typescript": "~3.4.3"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "cordova-plugin-whitelist": {},
      "cordova-plugin-statusbar": {},
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-ionic-webview": {
        "ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
      },
      "cordova-plugin-ionic-keyboard": {},
      "cordova-plugin-inappbrowser": {},
      "cordova-plugin-mfp": {},
      "cordova-sqlite-storage": {},
      "cordova-plugin-fingerprint-aio": {}
    },
    "platforms": [
      "browser",
      "ios",
      "android"
    ]
  }
}
  • cordova platform ls
    Android

Logs

I have tried in several devices with same error always
@engmsaleh engmsaleh added the bug label Dec 16, 2019
@NiklasMerz
Copy link
Owner

Did you try setting the paramter fallbackButtonTitle to show

Please check #212

@xiaohuoni
Copy link

@NiklasMerz Hello, I have the same problem. This is how I use it

Fingerprint.show({
            title:'快速登录',
            fallbackButtonTitle:'确定',
            disableBackup:false,
            cancelButtonTitle:'取消'
          }, successCallback, errorCallback);

@xiaohuoni
Copy link

I tried to add two parameters. I wrote the values at will. What should they be set correctly

Fingerprint.show({
            title:'快速登录',subtitle:'快速登录验证流程',description:'',
            fallbackButtonTitle:'确定',
            disableBackup:false,
            cancelButtonTitle:'取消',
            clientId:'123',
            clientSecret:'123212132'
          }

@engmsaleh
Copy link
Author

@NiklasMerz I don't think this is the problem as I see that all the show options are optional and I have already tried with all of them set and still getting the same error

@engmsaleh
Copy link
Author

@xiaohuoni I have tried to do that, but both clientId & clientSecret are removed from FAIO Options now and it will give an error when I add them

@NiklasMerz
Copy link
Owner

@NiklasMerz I don't think this is the problem as I see that all the show options are optional and I have already tried with all of them set and still getting the same error

fallbackButtonTitle should be mandatory. We may need to fix the Ionic native typing and docs. As always with plugin updates/changes try deleting the platforms and addding the again.

@xiaohuoni I have tried to do that, but both clientId & clientSecret are removed from FAIO Options now and it will give an error when I add them

Yes those are needed for the old version 2.x or below.

@engmsaleh
Copy link
Author

@NiklasMerz Adding fallbackButtonTitle solved the issue, thanks a lot

@xiaohuoni
Copy link

Yes those are needed for the old version 2.x or below.

@NiklasMerz
Why do I use yarn to install is 1.6.0 version?

@engmsaleh
Copy link
Author

@xiaohuoni I don't know why it happens when I use it on ionic, but I solved it by installing the plugin first, then the ionic-native wrapper
If I go the other way around I will get version 1.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants