Giter Site home page Giter Site logo

eddyverbruggen / nativescript-fingerprint-auth Goto Github PK

View Code? Open in Web Editor NEW
132.0 11.0 34.0 3.72 MB

:nail_care: 👱‍♂️ Forget passwords, use a fingerprint scanner or facial recognition!

License: MIT License

Shell 4.75% TypeScript 95.25%
nativescript nativescript-plugin fingerprint fingerprint-scanner touchid touch-id passcode faceid

nativescript-fingerprint-auth's Introduction

NativeScript Fingerprint Authentication

Also works with Face ID on iPhones 🚀

Build Status NPM version Downloads Twitter Follow

⚠️ Looking for NativeScript 7 compatibilty? Go to the NativeScript/plugins repo.

Installation

From the command prompt go to your app's root folder and execute:

tns plugin add nativescript-fingerprint-auth

Then open App_Resources/Android/AndroidManifest.xml and look for minSdkVersion. If that's set to a version less than 23, add this overrideLibrary line:

  <uses-sdk
      android:minSdkVersion="17"
      android:targetSdkVersion="__APILEVEL__"
      tools:overrideLibrary="com.jesusm.kfingerprintmanager"/>

Demo

If you want a quickstart, check out the demo app. Run it locally using these commands:

git clone https://github.com/EddyVerbruggen/nativescript-fingerprint-auth
cd nativescript-fingerprint-auth/src
npm run demo.android # or demo.ios

API

Want a nicer guide than these raw code samples? Read Nic Raboy's blog post about this plugin.

available

JavaScript

var fingerprintAuthPlugin = require("nativescript-fingerprint-auth");
var fingerprintAuth = new fingerprintAuthPlugin.FingerprintAuth();

fingerprintAuth.available().then(
    function(avail) {
      console.log("Available? " + avail);
    }
)

TypeScript

import { FingerprintAuth, BiometricIDAvailableResult } from "nativescript-fingerprint-auth";

class MyClass {
  private fingerprintAuth: FingerprintAuth;

  constructor() {
    this.fingerprintAuth = new FingerprintAuth();
  }

  this.fingerprintAuth.available().then((result: BiometricIDAvailableResult) => {
    console.log(`Biometric ID available? ${result.any}`);
    console.log(`Touch? ${result.touch}`);
    console.log(`Face? ${result.face}`);
  });
}

verifyFingerprint

Note that on the iOS simulator this will just resolve().

fingerprintAuth.verifyFingerprint(
	{
	  title: 'Android title', // optional title (used only on Android)
	  message: 'Scan yer finger', // optional (used on both platforms) - for FaceID on iOS see the notes about NSFaceIDUsageDescription
	  authenticationValidityDuration: 10, // optional (used on Android, default 5)
	  useCustomAndroidUI: false // set to true to use a different authentication screen (see below)
	})
	.then((enteredPassword?: string) => {
	  if (enteredPassword === undefined) {
	    console.log("Biometric ID OK")
	  } else {
	    // compare enteredPassword to the one the user previously configured for your app (which is not the users system password!)
	  }
	})
	.catch(err => console.log(`Biometric ID NOT OK: ${JSON.stringify(err)}`));

A nicer UX/UI on Android (useCustomAndroidUI: true)

The default authentication screen on Android is a standalone screen that (depending on the exact Android version) looks kinda 'uninteresting'. So with version 6.0.0 this plugin added the ability to override the default screen and offer an iOS popover style which you can activate by passing in useCustomAndroidUI: true in the function above.

One important thing to realize is that the 'use password' option in this dialog doesn't verify the entered password against the system password. It must be used to compare the entered password with an app-specific password the user previously configured.

The password fallback can be disabled by overriding the default use_password text to a blank string (see optional change below for details on how to do this).

Optional change

If you want to override the default texts of this popover screen, then drop a file strings.xml in your project and override the properties you like. See the demo app for an example.

⚠️ Important note when using NativeScript < 5.4.0

Use plugin version < 7.0.0 to be able to use this feature with NativeScript < 5.4.0

Skip this section if you're on NativeScript 5.4.0 or newer because it's all handled automatically!

To be able to use this screen, a change to App_Resources/Android/AndroidManifest.xml is required as our NativeScript activity needs to extend AppCompatActivity (note that in the future this may become the default for NativeScript apps).

To do so, open the file and replace <activity android:name="com.tns.NativeScriptActivity" by <activity android:name="org.nativescript.fingerprintplugin.AppCompatActivity".

Note that if you forget this and set useCustomAndroidUI: true the plugin will reject the Promise with a relevant error message.

Mandatory changes for webpack and snapshot builds (again, for NativeScript < 5.4.0 only)

If you are using Webpack with or without snapshot there are couple more changes required in order to make the custom UI work in your production builds.
First you need to edit your vendor-platform.android.ts file and add require("nativescript-fingerprint-auth/appcompat-activity");. You can see the changed file in the demo app here.
The second change should be made in your webpack.config.js file. Find the place where the NativeScriptSnapshotPlugin is pushed to the webpack plugins and add "nativescript-fingerprint-auth" in the tnsJavaClassesOptions.packages array. The result should look something like:

// ...
    if (snapshot) {
        config.plugins.push(new nsWebpack.NativeScriptSnapshotPlugin({
            chunk: "vendor",
            projectRoot: __dirname,
            webpackConfig: config,
            targetArchs: ["arm", "arm64", "ia32"],
            tnsJavaClassesOptions: {
                packages: ["tns-core-modules", "nativescript-fingerprint-auth"],
            },
            useLibs: false
        }));
    }
// ...

verifyFingerprintWithCustomFallback (iOS only, falls back to verifyFingerprint on Android)

Instead of falling back to the default Passcode UI of iOS you can roll your own. Just show that when the error callback is invoked.

fingerprintAuth.verifyFingerprintWithCustomFallback({
  message: 'Scan yer finger', // optional, shown in the fingerprint dialog (default: 'Scan your finger').
  fallbackMessage: 'Enter PIN', // optional, the button label when scanning fails (default: 'Enter password').
  authenticationValidityDuration: 10 // optional (used on Android, default 5)
}).then(
    () => {
      console.log("Fingerprint was OK");
    },
    error => {
      // when error.code === -3, the user pressed the button labeled with your fallbackMessage
      console.log("Fingerprint NOT OK. Error code: " + error.code + ". Error message: " + error.message);
    }
);

Face ID (iOS)

iOS 11 added support for Face ID and was first supported by the iPhone X. The developer needs to provide a value for NSFaceIDUsageDescription, otherwise your app may crash.

You can provide this value (the reason for using Face ID) by adding something like this to app/App_Resources/ios/Info.plist:

  <key>NSFaceIDUsageDescription</key>
  <string>For easy authentication with our app.</string>

Security++ (iOS)

Since iOS9 it's possible to check whether or not the list of enrolled fingerprints changed since the last time you checked it. It's recommended you add this check so you can counter hacker attacks to your app. See this article for more details.

So instead of checking the fingerprint after available add another check. In case didFingerprintDatabaseChange returns true you probably want to re-authenticate your user before accepting valid fingerprints again.

fingerprintAuth.available().then(avail => {
    if (!avail) {
      return;
    }
    fingerprintAuth.didFingerprintDatabaseChange().then(changed => {
        if (changed) {
          // re-auth the user by asking for his credentials before allowing a fingerprint scan again
        } else {
          // call the fingerprint scanner
        }
  });
});

Changelog

  • 6.2.0 Fixed a potential bypass on iOS.
  • 6.1.0 Fixed potentioal bypasses on Android.
  • 6.0.3 Android interfered with other plugins' Intents.
  • 6.0.2 Plugin not working correctly on iOS production builds / TestFlight.
  • 6.0.1 Fixed a compatibility issues with NativeScript 3.4.
  • 6.0.0 Allow custom UI on Android.
  • 5.0.0 Better Face ID support. Breaking change, see the API for available.
  • 4.0.1 Aligned with the official NativeScript plugin seed. Requires NativeScript 3.0.0+. Thanks, @angeltsvetkov!
  • 4.0.0 Converted to TypeScript. Changed the error response type of verifyFingerprintWithCustomFallback.
  • 3.0.0 Android support added. Renamed nativescript-touchid to nativescript-fingerprint-auth (sorry for any inconvenience!).
  • 2.1.1 Xcode 8 compatibility - requires NativeScript 2.3.0+.
  • 2.1.0 Added didFingerprintDatabaseChange for enhanced security.
  • 2.0.0 Added verifyFingerprintWithCustomFallback, verifyFingerprint now falls back to the passcode.
  • 1.2.0 You can now use the built-in passcode interface as fallback.
  • 1.1.1 Added TypeScript definitions.
  • 1.1.0 Added Android platform which will always return false for touchid.available.

nativescript-fingerprint-auth's People

Contributors

angeltsvetkov avatar bbroerees avatar bradmartin avatar danielgek avatar eddyverbruggen avatar gabrielbiga avatar peterstaev avatar stevenljackson1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nativescript-fingerprint-auth's Issues

Help with resumeEvent

We have a use case to prompt users for biometrics when ios or android resumes. Before switching to the custom android ui the following code was working:

          applicationOn(resumeEvent, (args: ApplicationEventData) => {
            
                    this.deviceService.initBiometricIDAvailablity();

                    // verify fingerprint ...
          });

We have switched to the custom ui on android so we could eliminate passcode fallback (working great); however, this also stops the resumeEvent from being triggered. I think this has something to do with extending the activity in appcompat-activity.android.

I've tried the non cross platform android on resume which fires the event but loses access to where our services and properties are defined for biometrics.

          android.on(AndroidApplication.activityResumedEvent, function (args: AndroidActivityEventData) {
            
                    this.deviceService.initBiometricIDAvailablity();  // TypeError: Cannot read property 'initBiometricIDAvailablity' of undefined

                    // verify fingerprint ...
          });

Any tips on how to achieve on resume with custom android ui would be greatly appreciated.

"touchid.available()" inside emulator returns false

I'm trying to run the example of code for Android 7.0 emulator. I set up a fingerprint and added the following code the the project

var observableModule = require("data/observable");
 
function pageLoaded(args) {
    var page = args.object;
    var data = new observableModule.Observable({authenticated: false});
    touchid.available().then(function(avail) {
        if(avail) {
            touchid.verifyFingerprint({
                message: "Scan with your finger",
                fallbackTitle: "Enter PIN"
            }).then(function() {
                data.authenticated = true;
            }, function(error) {
                console.log("Fingerprint NOT OK" + (error.code ? ". Code: " + error.code : ""));
            });
        }
    });
    page.bindingContext = data;
}
 
exports.pageLoaded = pageLoaded;

However, console displays that Fingerprint is not available:

JS: Avail:  false
JS: Fingerprint NOT OK

I suspect that something is wrong here. I'm using API v.24.
It would be great if you take a look on this issue. Thanks in advance!

Android build crashes with 6.0.0

Hi,
Since there are issues with the foreground activity being undefined in NS 3.4.1, I want to update nativescript-fingerprint-auth. While deploying the app to my Android phone works with version 5.1.0, I'm getting the following error with 6.0.0 and 6.0.1:

Running full build

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesWithDexForF0F1F2F3F4F5F6F7Debug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Lorg/intellij/lang/annotations/Identifier;

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 10s
Unable to apply changes on device: xxx. Error is: Command gradlew.bat failed with exit code 1.
Executing after-watch hook from D:\mobile-app\hooks\after-watch\nativescript-dev-sass.js
Executing after-watch hook from D:\mobile-app\hooks\after-watch\nativescript-dev-typescript.js

I have tried cleaning all (platforms remove, app uninstalling,..) but I can't get rid of this error. Any idea?

Android: Cipher error

Hello
During my development, when I do the touchid, I need to do several times the touch to get access.

Finally, I got and error:

S: touch?true
JS: Error: javax.crypto.AEADBadTagException
JS: android.security.keystore.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:517)
JS: javax.crypto.Cipher.doFinal(Cipher.java:2056)
JS: com.tns.Runtime.callJSMethodNative(Native Method)
JS: com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1021)
JS: com.tns.Runtime.callJSMethodImpl(Runtime.java:903)
JS: com.tns.Runtime.callJSMethod(Runtime.java:890)
JS: com.tns.Runtime.callJSMethod(Runtime.java:874)
JS: com.tns.Runtime.callJSMethod(Runtime.java:866)
JS: com.tns.NativeScriptActivity.onStart(NativeScriptActivity.java:38)
JS: android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1256)
JS: android.app.Activity.performStart(Activity.java:6959)
JS: android.app.Activity.performRestart(Activity.java:7075)
JS: android.app.Activity.performResume(Activity.java:7080)
JS: android.app.ActivityThread.performResumeActivity(ActivityThread.java:3768)
JS: android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3832)
JS: android.app.ActivityThread$H.handleMessage(ActivityThread.java:1681)
JS: android.os.Handler.dispatchMessage(Handler.java:102)
JS: android.os.Looper.loop(Looper.java:154)
JS: android.app.ActivityThread.main(ActivityThread.java:6682)
JS: java.lang.reflect.Method.invoke(Native Method)
JS: com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1534)
JS: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1424)
JS: Caused by: android.security.KeyStoreException: Signature/MAC verification failed
JS: android.security.KeyStore.getKeyStoreException(KeyStore.java:1107)
JS: android.security.keystore.KeyStoreCryptoOperationChunkedStreamer.update(KeyStoreCryptoOperationChunkedStreamer.java:132)
JS: android.security.keystore.KeyStoreCryptoOperationChunkedStreamer.doFinal(KeyStoreCryptoOperationChunkedStreamer.java:217)
JS: android.security.keystore.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:506)
JS: javax.crypto.Cipher.doFinal(Cipher.java:2056)
JS: com.tns.Runtime.callJSMethodNative(Native Method)
JS: com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1021)
JS: com.tns.Runtime.callJSMethodImpl(Runtime.java:903)
JS: com.tns.Runtime.callJSMethod(Runtime.java:890)
JS: com.tns.Runtime.callJSMethod(Runtime.java:874)
JS: com.tns.Runtime.callJSMethod(Runtime.java:866)
JS: com.tns.NativeScriptActivity.onStart(NativeScriptActivity.java:38)
JS: android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1256)
JS: android.app.Activity.performStart(Activity.java:6959)
JS: android.app.Activity.performRestart(Activity.java:7075)
JS: android.app.Activity.performResume(Activity.java:7080)
JS: android.app.ActivityThread.performResumeActivity(ActivityThread.java:3768)
JS: android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3832)
JS: android.app.ActivityThread$H.handleMessage(ActivityThread.java:1681)
JS: android.os.Handler.dispatchMessage(Handler.java:102)
JS: android.os.Looper.loop(Looper.java:154)
JS: android.app.ActivityThread.main(ActivityThread.java:6682)
JS: java.lang.reflect.Method.invoke(Native Method)
JS: com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1534)
JS: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1424)
JS: << UIApplication: com.tns.NativeScriptActivity@9a13e33 resume >>
JS: RDY TO RESUME>>>>>>>>>>>>>:
JS: IsSignedId in resume with SUSPENDED: true
JS: Enter in touchIdGoHome resume
JS: touch?true
JS: Error: javax.crypto.AEADBadTagException
JS: android.security.keystore.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:517)
JS: javax.crypto.Cipher.doFinal(Cipher.java:2056)
JS: com.tns.Runtime.callJSMethodNative(Native Method)
JS: com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1021)
JS: com.tns.Runtime.callJSMethodImpl(Runtime.java:903)
JS: com.tns.Runtime.callJSMethod(Runtime.java:890)
JS: com.tns.Runtime.callJSMethod(Runtime.java:874)
JS: com.tns.Runtime.callJSMethod(Runtime.java:866)
JS: com.tns.gen.android.app.Application_ActivityLifecycleCallbacks.onActivityResumed(Application_ActivityLifecycleCallbacks.java:24)
JS: android.app.Application.dispatchActivityResumed(Application.java:240)
JS: android.app.Activity.onResume(Activity.java:1331)
JS: android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1277)
JS: android.app.Activity.performResume(Activity.java:7088)
JS: android.app.ActivityThread.performResumeActivity(ActivityThread.java:3768)
JS: android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3832)
JS: android.app.ActivityThread$H.handleMessage(ActivityThread.java:1681)
JS: android.os.Handler.dispatchMessage(Handler.java:102)
JS: android.os.Looper.loop(Looper.java:154)
JS: android.app.ActivityThread.main(ActivityThread.java:6682)
JS: java.lang.reflect.Method.invoke(Native Method)
JS: com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1534)
JS: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1424)
JS: Caused by: android.security.KeyStoreException: Signature/MAC verification failed
JS: android.security.KeyStore.getKeyStoreException(KeyStore.java:1107)
JS: android.security.keystore.KeyStoreCryptoOperationChunkedStreamer.update(KeyStoreCryptoOperationChunkedStreamer.java:132)
JS: android.security.keystore.KeyStoreCryptoOperationChunkedStreamer.doFinal(KeyStoreCryptoOperationChunkedStreamer.java:217)
JS: android.security.keystore.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:506)
JS: javax.crypto.Cipher.doFinal(Cipher.java:2056)
JS: com.tns.Runtime.callJSMethodNative(Native Method)
JS: com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1021)
JS: com.tns.Runtime.callJSMethodImpl(Runtime.java:903)
JS: com.tns.Runtime.callJSMethod(Runtime.java:890)
JS: com.tns.Runtime.callJSMethod(Runtime.java:874)
JS: com.tns.Runtime.callJSMethod(Runtime.java:866)
JS: com.tns.gen.android.app.Application_ActivityLifecycleCallbacks.onActivityResumed(Application_ActivityLifecycleCallbacks.java:24)
JS: android.app.Application.dispatchActivityResumed(Application.java:240)
JS: android.app.Activity.onResume(Activity.java:1331)
JS: android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1277)
JS: android.app.Activity.performResume(Activity.java:7088)
JS: android.app.ActivityThread.performResumeActivity(ActivityThread.java:3768)
JS: android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3832)
JS: android.app.ActivityThread$H.handleMessage(ActivityThread.java:1681)
JS: android.os.Handler.dispatchMessage(Handler.java:102)
JS: android.os.Looper.loop(Looper.java:154)
JS: android.app.ActivityThread.main(ActivityThread.java:6682)
JS: java.lang.reflect.Method.invoke(Native Method)
JS: com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1534)
JS: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1424)
JS: UPDATE appStatus Success RUN 1

++++++++++++++++++

If you see in the previous code, the app got the authentication but I need to touch couple of times before get access.

This is my package.json

{
"description": "NativeScript Application",
"license": "SEE LICENSE IN ",
"readme": "NativeScript Application",
"repository": "",
"nativescript": {
"id": "xxxxxx",
"tns-android": {
"version": "3.0.1"
},
"tns-ios": {
"version": "3.1.0"
}
},
"dependencies": {
"@angular/common": "4.2.5",
"@angular/compiler": "4.2.5",
"@angular/core": "4.2.5",
"@angular/forms": "4.2.5",
"@angular/http": "4.2.5",
"@angular/platform-browser": "4.2.5",
"@angular/router": "4.2.5",
"base-64": "0.1.0",
"nativescript-angular": "3.0.0",
"nativescript-cardview": "2.0.2",
"nativescript-collapsing-header": "2.0.0",
"nativescript-exit": "1.0.1",
"nativescript-fingerprint-auth": "4.0.0",
"nativescript-floatingactionbutton": "3.0.0",
"nativescript-grid-view": "3.0.0",
"nativescript-intl": "3.0.0",
"nativescript-loading-indicator": "2.3.2",
"nativescript-master-technology": "1.1.1",
"nativescript-oauth": "file:../nativescript-oauth",
"nativescript-sqlite": "^1.1.7",
"nativescript-statusbar": "1.0.0",
"nativescript-telerik-ui": "2.0.1",
"rxjs": "5.4.1",
"tns-core-modules": "3.0.1",
"utf8": "2.1.2",
"zone.js": "0.8.12"
},
"devDependencies": {
"babel-traverse": "6.22.0",
"babel-types": "6.25.0",
"babylon": "6.17.4",
"filewalker": "0.1.3",
"lazy": "1.0.11",
"nativescript-dev-typescript": "0.4.5",
"tns-platform-declarations": "3.0.1",
"tslint": "5.4.3",
"typescript": "2.3.4"
}
}
Thanks

How can I distinguish fingerprints?

Hi, is there possibility to distinguish fingerprints?
For example, how to get name of fingerprint or its ID after successful authentication.

The idea is storing different information for different fingerprints in local storage and get it after authentication.

Thanks!

CustomUI for android does not trigger on keyboard enter

Using the plugin (7.0.1) on Nativescript angular (5.4.0) with custom android UI:
When the user chooses to use pin instead of fingerprint, enters the pincode and does not press 'OK' in the dialog but the enter key on the keyboard, the dialog gets closed but the callback of verifyFingerprint is never called.

Cannot set property 'useCustomAndroidUI' of undefined

Im create a app with angular template and when i try use

verifyFingerprint(options)

i always get the cannot set property useCustoAndroidUI.

my Options:

this.verifyOptions.useCustomAndroidUI = false;
this.verifyOptions.authenticationValidityDuration = 50;
this.verifyOptions.message = "coloca ai";
this.verifyOptions.title = "É Tu??";

I need set any other setting when using nativescript angular template?

The new package failed because the current SDK version is older than that required by the package.

I'm getting this error : The new package failed because the current SDK version is older than that required by the package..

<?xml version="1.0" encoding="utf-8"?>
<manifest
    xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="__PACKAGE__" android:versionCode="1" android:versionName="1.0">
    <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" />
    <uses-sdk
    android:minSdkVersion="23"
    android:targetSdkVersion="__APILEVEL__"
    tools:overrideLibrary="com.jesusm.kfingerprintmanager"/>
    <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="__APILEVEL__" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <application android:name="com.tns.NativeScriptApplication" android:allowBackup="true" android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@style/AppTheme">
        <activity android:windowSoftInputMode="adjustResize" android:name="com.tns.NativeScriptActivity" android:label="@string/title_activity_kimera" android:configChanges="keyboardHidden|orientation|screenSize" android:theme="@style/LaunchScreenTheme" android:screenOrientation="userPortrait">
            <meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="@style/AppTheme" />
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name="com.tns.ErrorReportActivity" />
    </application>
</manifest>

I'm using nativescript-fingerprint-auth V.6.2.0.

iOS Passcode fallback never presented after failed TouchID

Using the Demo app on my iOS device, the "verify with passcode fallback" call simply reverts to the catch alert() in doVerifyFingerprint() after 3 failed attempts using touch. No err is displayed (undefined), only the title and okButtonText.
my iOS version: 12.1.3

Missing class

Hello,
I get this error on app startup

System.err: java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.gem.live/org.nativescript.fingerprintplugin.AppCompatActivity}: java.lang.ClassNotFoundException: Didn't find class "org.nativescript.fingerprintplugin.AppCompatActivity" on path: DexPathList[[zip file "/data/app/com.gem.live-sdOgOMnXlHlx3bvBx5fbwQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.gem.live-sdOgOMnXlHlx3bvBx5fbwQ==/lib/arm, /data/app/com.gem.live-sdOgOMnXlHlx3bvBx5fbwQ==/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib, /product/lib]]
System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3064)
System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3278)
System.err: at android.app.ActivityThread.-wrap12(Unknown Source:0)
System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1894)
System.err: at android.os.Handler.dispatchMessage(Handler.java:109)
System.err: at android.os.Looper.loop(Looper.java:166)
System.err: at android.app.ActivityThread.main(ActivityThread.java:7377)
System.err: at java.lang.reflect.Method.invoke(Native Method)
System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:469)
System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:963)
System.err: Caused by: java.lang.ClassNotFoundException: Didn't find class "org.nativescript.fingerprintplugin.AppCompatActivity" on path: DexPathList[[zip file "/data/app/com.gem.live-sdOgOMnXlHlx3bvBx5fbwQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.gem.live-sdOgOMnXlHlx3bvBx5fbwQ==/lib/arm, /data/app/com.gem.live-sdOgOMnXlHlx3bvBx5fbwQ==/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib, /product/lib]]
System.err: at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)
System.err: at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
System.err: at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
System.err: at android.app.Instrumentation.newActivity(Instrumentation.java:1179)
System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3054)
System.err: ... 9 more

iOS verifyFingerprintWithCustomFallback() method fallback error alert freezes the UI

we have used this plugin to login using the touch id and we are facing the following issue

when i call the function verifyFingerprintWithCustomFallback() on load for the success scenario it works but in iOS after continuous failed attempt the Biometry is locked so when you call this function on load it executes the error i am just triggering the alert in this error block.

now the alert window freezes the UI please see the attached Screen shot

this.fingerprintAuth.verifyFingerprintWithCustomFallback({ message: 'Sign in with the online ID ' + this.userName.substring(0, 3) + this.userName.substring(3).replace(/./g, '*'), // optional fallbackMessage: 'Password' // optional }).then( () => { this.navHome(); }, (error) => { dialogs.alert({ title: "Touch ID is locked out`",
message: ("please lock the device and unlock the device"),
okButtonText: "Ok"
});

    }
  });

}`

screen shot 2017-07-05 at 11 49 09 am

Plugin not working when deployed via TestFlight/iTunesConnect

When using the plugin in a production build deployed via tns publish ios the availability check seems to fail.

The code we are running and which works in a normal development build fine, are the following lines of code:

 public ngOnInit() {
       this.authenticate();
    }

    private async authenticate() {
        let fSuccessful: boolean = false;
        const fAvailable: BiometricIDAvailableResult = await this.fingerprintAuth.available();

        if (this.secureStorageService.isFingerprintSettingEnabled() && fAvailable.any) {
            try {
                await this.doVerifyFingerprint();
                fSuccessful = true;
            } catch (e) {
                trace.write("Error during fingerprint authentication: " + e, trace.categories.Debug);
            }
        }

        if (fSuccessful) {
            this.routerExtensions.navigate(["/home"], {clearHistory: true, animated: false});
        } else {
            this.routerExtensions.navigate(["/authenticate"], {clearHistory: true, animated: false});
        }
    }

    private doVerifyFingerprint(): Promise<void> {
        return this.fingerprintAuth.verifyFingerprintWithCustomFallback({
            fallbackMessage: localize("authenticate.scanFallback"),
            message: localize("authenticate.scanFinger"),
        });
    }

Since it is somehow very hard to get some information from a TestFlight build about what's happening, I could figure out the following error in the console.app on my mac:

-[LAClient evaluatePolicy:options:uiDelegate:reply:]_block_invoke -> (null), Error Domain=com.apple.LocalAuthentication Code=-1004 "User interaction is required." UserInfo={FingerDatabaseHash=<886d059e ec073f18 ec996a29 27374575 4d1b9c2b 42ecef54 f7b134db 335584f9>, BiometryType=1, AvailableMechanisms=(
    1
), NSLocalizedDescription=User interaction is required.} on <private>

The app is not crashing but the availability functionality is not working, it seems to be false although my phone has TouchID enabled and it works fine in development builds locally.

When downgrading the plugin to version 4.0.1 it works fine for iOS, but there we have the problem of the compatibility on Android with the new nativescript version.

We would like to find a way fixing the problem but currently we're pretty lost. We don't really understand what's the difference between the local build and a TestFlight build, what happens there that could influence the plugin's functionality.

Any suggestions for the analytics or solutions of the problem?

CustomAndroidUI will not use device password to authenticate, here's why

https://github.com/JesusM/FingerprintManager/blob/333e4ca4e44d5c5fb725e8926690000d926af880/javasample/src/main/java/com/jesusm/fingerprintmanager/javasample/MainActivity.java#L74

onSuccessWithManualPassword was intended to be used when the developer will manually maintain
a separate app password. Which he will compare.
So you would want to resolve(password) here,

but by doing so, the functionality of using password won't be same between using and not using custom UI.

com.tns.NativeScriptException: Failed to find module

I'm using the latest 3.4.1 version with Android.

When AndroidManifest.xml has : android:name="com.tns.NativeScriptActivity" , then everything is working fine.

It runs OK even with tns run android --bundle

Now I set android:name="org.nativescript.fingerprintplugin.AppCompatActivity" without --bundle ,and it runs OK.

However , When I use --bundle and : android:name="org.nativescript.fingerprintplugin.AppCompatActivity" instead , then I get an error :

Error: com.tns.NativeScriptException: Failed to find module: "./tns_modules/nativescript-fingerprint-auth/appcompat-activity.js", relative to: app//
System.err:     com.tns.Module.resolvePathHelper(Module.java:146)
System.err:     com.tns.Module.resolvePath(Module.java:55)
System.err:     com.tns.Runtime.runModule(Native Method)
System.err:     com.tns.Runtime.runModule(Runtime.java:530)
System.err:     com.tns.Runtime.createJSInstance(Runtime.java:624)
System.err:     com.tns.Runtime.initInstance(Runtime.java:606)
System.err:     org.nativescript.fingerprintplugin.AppCompatActivity.<init>(AppCompatActivity.java:7)
System.err:     java.lang.Class.newInstance(Native Method)
System.err:     android.app.Instrumentation.newActivity(Instrumentation.java:1078)
System.err:     android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2538)
System.err:     android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
System.err:     android.app.ActivityThread.-wrap12(ActivityThread.java)
System.err:     android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
System.err:     android.os.Handler.dispatchMessage(Handler.java:102)
System.err:     android.os.Looper.loop(Looper.java:154)
System.err:     android.app.ActivityThread.main(ActivityThread.java:6077)
System.err:     java.lang.reflect.Method.invoke(Native Method)
System.err:     com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
System.err:     com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
System.err: File: "<unknown>, line: 1, column: 265

Full log

Of Course i've tried platform remove/add

And this is a sample empty project which shows the problem
``

Verify finger print error

Hello!

"tns-ios": {
"version": "3.4.1"
},
"tns-android": {
"version": "3.4.1"
}
"nativescript-fingerprint-auth": "^4.0.1",

Error in fingerprint-auth.verifyFingerprint: TypeError: Cannot set property 'onActivityResult' of undefined

updated to 6.0.0

Error in fingerprint-auth.verifyFingerprint: TypeError: Cannot read property 'getSupportFragmentManager' of undefined

calling this function on ngAfterViewInit

Android 7.0 not working

I'm testing on 3 Android devices, none of which have touchID functionality
the function "fingerprintAuth.available()" doesnt return anything on a Sony Xperia - L1, Android 7.0
it works fine on a Sony Z3 (Android 6.01) and an HTC Sense (Android 4.4.2)
Also works for my iPhone and iPad.
Any ideas why Android 7.0 would have problems?
Thanks

Execution failed for task ':app:copyMetadata'.

I'm getting this crash while trying to run application for android

Execution failed for task ':app:copyMetadata'.

My minSDK version is 17 and I've added all the necessary changes

    <manifest
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        package="__PACKAGE__" android:versionCode="205" android:versionName="0.2.5">
    <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true"
                      android:xlargeScreens="true"/>
    <uses-sdk android:minSdkVersion="17"
              android:targetSdkVersion="__APILEVEL__"
              tools:overrideLibrary="com.jesusm.kfingerprintmanager"/>

My tns core module version is 4.2.0

Missing documentation regarding strings.xml

In the readme the suggestion is given to set the strings used for customandroidUI manually in strings.xml and says to see the demo as an example. The example however does not contain such a file.

iOS face-id fails in simulator

I've got an iPhone X simulator and when running code verifyFingerprint() fails immediately.

I've enrolled the simulator for face-id - available() results returns true for .any and .face.

I've added the NSFaceIDUsageDescription entry to plist file.

When verifyFingerprint() is called, the promise calls the 2nd reject function.

My code is exactly the same as in the demo code.

Angular integration - VerifyFingerprint not working

In my Angular integration 'verifyFingerprint' does not work on iOS and Android. However, 'verifyFingerprintWithcustomfallback' seems to work fine.

Problem: When using verifyFingerprint, the popup is not shown but immediately rejected. I should mention that I have a nativescript angular shared project.

Nativescript 6 Update error- Unable to instantiate activity ComponentInfo{org.nsf.myapp/org.nativescript.fingerprintplugin.AppCompatActivity}:

After Updating the app to version 6. Not able to debug or build
tns debug android --bundle

System.err: Unable to instantiate activity ComponentInfo{org.nsf.myapp/org.nativescript.fingerprintplugin.AppCompatActivity}: java.lang.ClassNotFoundException: Didn't find class "org.nativescript.fingerprintplugin.AppCompatActivity" on path: DexPathList[[zip file "/data/app/org.nsf.myapp-z67-cJAhPFGRLXmJChBdQA==/base.apk"],nativeLibraryDirectories=[/data/app/org.nsf.myapp-z67-cJAhPFGRLXmJChBdQA==/lib/arm64, /data/app/org.nsf.myapp-z67-cJAhPFGRLXmJChBdQA==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]]

Android: if only password set then it fails (not a bug per say, more a question for a PR)

hey @EddyVerbruggen - I know this is fingerprint auth so if you don't want to add the change just let me know.

Currently, if the android device has a fingerprint enrolled, then they are presented with the default security option PLUS the option to use the fingerprint to authenticate.

In some cases, they don't have the fingerprint enrolled but might have a passcode set.

I'm trying to think of a way to make a PR to this plugin that doesn't cause any breaking changes but I'm coming up short right now, maybe you have some thoughts since you're more familiar with the code base.

Right now I'm using the entire fingerprint-auth plugin as a way to prevent users from accessing sensitive material. I wanted it to fallback to whatever the user has configured regardless of fingerprint. I know that goes against the entire 'name' of the plugin 😄 so maybe it's best to not mess with it. However, the following isKeyguardSecure method will return true if any security is configured so I'm just using it to resolve and then still presenting the user with the device security intent.

I'm just not sure the best way to wrap this into a PR. Maybe the available call can add an optional argument to check isDeviceSecure: boolean and then we can still resolve on that method alone and of course it wouldn't have to return touch: true in that scenario.

I'm not very clear on the iOS side yet as I haven't had to do a lot of digging there yet so maybe that change doesn't make sense to enable.

    const y = this.keyguardManager.isKeyguardSecure();
        console.log("IS KEYGUARD SECURE?", y);
        // if the device only has a password set the fingerprint enrolled method is going to fail bc no fingerprints have been enrolled :/
        if (
          this.keyguardManager.isKeyguardSecure()
        ) {
          resolve({
            any: true,
            touch: false
          });
        }

Support AndroidX and remove our custom activity

AndroidX is required for {N} 6, and the custom activity is no longer needed since {N} 5.4. I think I'll just remove it so users on {N} version < 5.4 will have to stick to older plugin versions. That's why this will be a major version bump.

Face recognition is ON but shows `undefined` ( android).

I'm checking the available object :

  this._fingerPrintService.isFingerPrintAvilable().then(f=>console.log(JSON.stringify(f)));

Where the service is actually :

    isFingerPrintAvilable(): Promise<BiometricIDAvailableResult>
    {
        
        return this.fingerprintAuth.available().then((result: BiometricIDAvailableResult) =>
                                                    {
                                                        console.log(`Biometric ID available? ${result.any}`);
                                                        console.log(`Touch? ${result.touch}`);
                                                        console.log(`Face? ${result.face}`);
                                                        return result;
                                                    });
    }

Result :

JS: Biometric ID available? true
JS: Touch? true
JS: Face? **undefined**

Why is that ?

As you can see - I do have facere cognition on:

image

But all it shows me is this menu :

image

Question

Why doesn't it allow me to be recognized via face ?

(it does recognize me via fingerprint & pattern) - I have galaxy s8+

BTW - when I lock the phone it does show me that I can use face :

image

Angular integration - Module not found error

I am using the module in my Angular project and getting the below error

Module not found: Error: Can't resolve 'nativescript-fingerprint-auth'

When I debugged error happens in the below statement

this.fingerprintAuth = new FingerprintAuth();

FingerPrint shows strange on android for HuaWei or Xiaomi

The fingerprint for Samsung(SM-G9280) is ok,the screenshot is as belows:
samsung
But for HuaWei or Xiaomi ,it enters pin code page, while "Touch ID is available",which confuses me, the result is as follows on Huawei Note8 ( Huawei EMUI4.1+Android 6.0)

huawei
How can I fix the problem?

Feature request: Custom android UI without password fallback option

The title gives most of it away.
It would be nice to have the option for custom android UI for no password fallback, so only a cancel button in the fingerprint dialog.

Update
This can be achieved by setting the use_password string in strings.xml to empty. The button to cancel will not be shown. Request to update readme to inform others.

nativescript-vue gives gradlew error

Simply created a new nativescript-vue (1.3.1) project, and installed the plugin. I don't see any configurations or pre-install steps that I need to follow.

It runs then stops at the following error:

Preparing project...
Successfully prepared plugin nativescript-fingerprint-auth for android.
Successfully prepared plugin nativescript-theme-core for android.
Successfully prepared plugin nativescript-vue for android.
Successfully prepared plugin tns-core-modules for android.
Successfully prepared plugin tns-core-modules-widgets for android.
Built aar for nativescript-fingerprint-auth
Project successfully prepared (Android)
Building project...
Gradle build...
         + applying user-defined configuration from C:\Projects\Nativescript\biometric_test\dist\app\App_Resources\Android\app.gradle
Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead.
Configuration 'debugCompile' in project ':app' is deprecated. Use 'debugImplementation' instead.
         + adding nativescript runtime package dependency: nativescript-optimized
         + adding aar plugin dependency: C:\Projects\Nativescript\biometric_test\dist\node_modules\nativescript-fingerprint-auth\platforms\android\nativescript_fingerprint_auth.aar
         + adding aar plugin dependency: C:\Projects\Nativescript\biometric_test\dist\node_modules\tns-core-modules-widgets\platforms\android\widgets-release.aar
Unable to apply changes on device: emulator-5554. Error is: Command gradlew.bat failed with exit code 1.

package.json

"dependencies": {
    "nativescript-fingerprint-auth": "^6.0.3",
    "nativescript-theme-core": "^1.0.4",
    "nativescript-vue": "^1.3.1",
    "tns-core-modules": "~3.4.1"
  },
  "devDependencies": {
    "babel-core": "^6.26.0",
    "babel-loader": "^7.1.4",
    "babel-plugin-transform-object-rest-spread": "^6.26.0",
    "babel-preset-env": "^1.6.1",
    "copy-webpack-plugin": "^4.5.1",
    "css-loader": "^0.28.11",
    "extract-text-webpack-plugin": "^3.0.2",
    "fs-extra": "^5.0.0",
    "nativescript-vue-externals": "^0.1.2",
    "nativescript-vue-loader": "^0.1.5",
    "nativescript-vue-target": "^0.1.0",
    "nativescript-vue-template-compiler": "^1.3.1",
    "node-sass": "^4.7.2",
    "ns-vue-loader": "^0.1.2",
    "optimize-css-assets-webpack-plugin": "^3.2.0",
    "rimraf": "^2.6.2",
    "sass-loader": "^6.0.7",
    "vue-template-compiler": "^2.5.16",
    "webpack": "^3.11.0",
    "webpack-synchronizable-shell-plugin": "0.0.7",
    "winston-color": "^1.0.0"
  }

tns-android: 4.0.1

Please help ?

verifyFingerprint without white screen

How can I just call the verifyFingerprint method without having to see an auxiliary screen ??
I would like it to just show up a dialog telling you the functionality, not the white screen.

Can someone help me??

Thank`s

Secure lock screen hasn't been set up

Hi,
When I set useCustomAndroidUI to true and change the AndroidManifiest.xml, y get the error:
{"code":30,"message":"Secure lock screen hasn't been set up.\n Go to "Settings -> Security -> Screenlock" to set up a lock screen."}

But, I test the app with a phone with screen lock setted by password!

If I change useCustomAndroidUI to false, It runs OK!

Please can you help me?

tns --versión: 4.0.1
Android: 6.0.1 (marshmallow)

nativescript-fingerprint-auth 5.0.0 reset Object

We are using "nativescript-fingerprint-auth" library 5.0.0 version, i have tried invalid fingerprint for first and second times showing "Try Again" popup message, For third time library was return -1 error code, Even i continue invalid fingerprint for 4th and 5th time it was show "Try Again" popup. Again i tried for 6th time library was return -8, even i tried 7th time library return "undefined". Then after when i try invalid fingerprint its always return "undefined".

We need after tried third times reset fingerprint object.

PFB code here i have initialized fingerprint object on two place.

constructor( ) { this.fingerprintAuth = new FingerprintAuth(); } this.fingerprintAuth.available().then((avail: any) => { if (avail) { this.fingerprintAuth.verifyFingerprintWithCustomFallback({ message: "Scan your finger", fallbackMessage: "Decline" }).then( () => {}, (error) => { if (error.code === -1 ) { this.fingerprintAuth = new FingerprintAuth(); } } } }

Tested Device : iphone 6.

IOS code access, no error code (always undefined)

On an IOS device when canceling the access code, you do not receive an error code.
With Android you get an error code 60 with IOS, the error is always undefined.
I cannot make a distinguish whether or not the access code is enabled on the device.

Android: minSdkVersion 17 cannot be smaller than version 23

hey,

I am trying to add nativescript-fingerprint-auth.

When I build for Android, I am getting this error:

* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 17 cannot be smaller than version 23 declared in library [com.github.JesusM:FingerprintManager:v2.0.2] /Users/witalec/.gradle/caches/transforms-1/files-1.1/FingerprintManager-v2.0.2.aar/cbc3c418a7ed90935aaea75c6cf2ad9a/AndroidManifest.xml as the library might be using APIs not available in 17
        Suggestion: use a compatible library with a minSdk of at most 17,
                or increase this project's minSdk version to at least 23,
                or use tools:overrideLibrary="com.jesusm.kfingerprintmanager" to force usage (maylead to runtime failures)

my AndroidManifest.xml has the following setting:

<uses-sdk
android:minSdkVersion="23"
android:targetSdkVersion="__APILEVEL__"/>

My runtime is:

"tns-android": {
    "version": "4.0.0-rc-2018.3.22.1"
}

but I also tried with:

"tns-android": {
"version": "3.4.0"
}

I am using NativeScript@rc

Any idea what I am doing wrong?

iOS NativeScript 6 compat

With {N} 6, the utils.ios.getter method was removed, so let's remove usages from this codebase as well.

Missing demo app

The link to the auth-demo is dead. Did you remove that repository?

Best,
Sven

getSystemService("fingerprint") ?

Hi.

Is there any reason for this line ?

 const fingerprintManager = utils.ad.getApplicationContext().getSystemService("fingerprint");

IMHO it should be

  const fingerprintManager = getApplicationContext().getSystemService(android.content.Context.FINGERPRINT_SERVICE);

(i'm referring to "fingerprint" vs android.content.Context.FINGERPRINT_SERVICE)

Which does exists in 23 ( for example)

image

It's just that I got a null reference

image

for this line :

  var fingerprintManager = utils.ad.getApplicationContext().getSystemService("fingerprint");
                if (!fingerprintManager.isHardwareDetected()) {       <--- here
                    reject("Device doesn't support fingerprint authentication");
                }

FaceID auth does not work

Hi, I'm new to this plugin and to NativeScript in general so maybe I did something stupid simple wrong, however, I am figuring this out for a while now and have absolutely no idea how to make it work.

Errors from the console:

    -[LAContext initWithExternalizedContext:] 0 on <private>
    -[LAContext canEvaluatePolicy:error:]_block_invoke 1 on <private>
    -[LAClient evaluatePolicy:options:uiDelegate:reply:] 1, {
    1000 = 1;
    }, (null) on <private>
    -[LAClient evaluatePolicy:options:uiDelegate:reply:]_block_invoke -> (null), Error Domain=com.apple.LocalAuthentication Code=-1004 "User interaction is required." UserInfo={FingerDatabaseHash=<74e03e0a 6f5c9e7c 1c949556 744571fc e0d72afd 35d5a0d5 14b6bf1b bf4fc2a1>, BiometryType=2, AvailableMechanisms=(
    7
    ), NSLocalizedDescription=User interaction is required.} on <private>
    -[LAContext canEvaluatePolicy:error:]_block_invoke -> YES on <private>
    Retrieving resting unlock: 0
    CONSOLE LOG file:///app/app.js:19014:18: 'Biometric ID available? true'
    CONSOLE LOG file:///app/app.js:19015:18: 'Touch? false'
    CONSOLE LOG file:///app/app.js:19016:18: 'Face? true'
    LAEvaluateAndUpdateACL(<private>, , (null))
    LAEvaluateAndUpdateACL -> 1, (null)
    CONSOLE LOG file:///app/app.js:19159:28: 'Error in fingerprint-auth.verifyFingerprint: TypeError: undefined is not an object (evaluating \134'options.message\134')'
    CONSOLE LOG file:///app/app.js:19027:22: 'Biometric ID NOT OK: {"line":19149,"column":66,"sourceURL":"file:///app/app.js"}'
    -[LAContext dealloc]  on <private>

Plugin crash on wiko highway signs

Hi,
This plugin crash on my wiko highway signs, I get the following error.
Successfully synced application net.articatech.mobile.app on device 0123456789ABCDEF. F/art (10362): art/runtime/check_jni.cc:65] from java.lang.Object com.tns.Runtime.callJSMethodNative(int, int, java.lang.String, int, boolean, java.lang.Object[]) F/art (10362): art/runtime/check_jni.cc:65] at com.tns.Runtime.callJSMethodNative(Native method) F/art (10362): art/runtime/check_jni.cc:65] at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1043) F/art (10362): art/runtime/check_jni.cc:65] at com.tns.Runtime.callJSMethodImpl(Runtime.java:925) F/art (10362): art/runtime/check_jni.cc:65] at com.tns.Runtime.callJSMethod(Runtime.java:912) F/art (10362): art/runtime/check_jni.cc:65] at com.tns.Runtime.callJSMethod(Runtime.java:896) F/art (10362): art/runtime/check_jni.cc:65] at com.tns.Runtime.callJSMethod(Runtime.java:888) F/art (10362): art/runtime/runtime.cc:289] at com.tns.Runtime.callJSMethodNative(Native method) F/art (10362): art/runtime/runtime.cc:289] at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1043) F/art (10362): art/runtime/runtime.cc:289] at com.tns.Runtime.callJSMethodImpl(Runtime.java:925) F/art (10362): art/runtime/runtime.cc:289] at com.tns.Runtime.callJSMethod(Runtime.java:912) F/art (10362): art/runtime/runtime.cc:289] at com.tns.Runtime.callJSMethod(Runtime.java:896) F/art (10362): art/runtime/runtime.cc:289] at com.tns.Runtime.callJSMethod(Runtime.java:888) F/art (10362): art/runtime/runtime.cc:289] at com.tns.Runtime.callJSMethodNative(Native method) F/art (10362): art/runtime/runtime.cc:289] at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1043) F/art (10362): art/runtime/runtime.cc:289] at com.tns.Runtime.callJSMethodImpl(Runtime.java:925) F/art (10362): art/runtime/runtime.cc:289] at com.tns.Runtime.callJSMethod(Runtime.java:912) F/art (10362): art/runtime/runtime.cc:289] at com.tns.Runtime.callJSMethod(Runtime.java:896) F/art (10362): art/runtime/runtime.cc:289] at com.tns.Runtime.callJSMethod(Runtime.java:888) F/art (10398): art/runtime/check_jni.cc:65] from java.lang.Object com.tns.Runtime.callJSMethodNative(int, int, java.lang.String, int, boolean, java.lang.Object[]) F/art (10398): art/runtime/check_jni.cc:65] at com.tns.Runtime.callJSMethodNative(Native method) F/art (10398): art/runtime/check_jni.cc:65] at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1043) F/art (10398): art/runtime/check_jni.cc:65] at com.tns.Runtime.callJSMethodImpl(Runtime.java:925) F/art (10398): art/runtime/check_jni.cc:65] at com.tns.Runtime.callJSMethod(Runtime.java:912) F/art (10398): art/runtime/check_jni.cc:65] at com.tns.Runtime.callJSMethod(Runtime.java:896) F/art (10398): art/runtime/check_jni.cc:65] at com.tns.Runtime.callJSMethod(Runtime.java:888) F/art (10398): art/runtime/runtime.cc:289] at com.tns.Runtime.callJSMethodNative(Native method) F/art (10398): art/runtime/runtime.cc:289] at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1043) F/art (10398): art/runtime/runtime.cc:289] at com.tns.Runtime.callJSMethodImpl(Runtime.java:925) F/art (10398): art/runtime/runtime.cc:289] at com.tns.Runtime.callJSMethod(Runtime.java:912) F/art (10398): art/runtime/runtime.cc:289] at com.tns.Runtime.callJSMethod(Runtime.java:896) F/art (10398): art/runtime/runtime.cc:289] at com.tns.Runtime.callJSMethod(Runtime.java:888)

My code:

var fingerprintAuthPlugin = require("nativescript-fingerprint-auth");
var fingerprintAuth = new fingerprintAuthPlugin.FingerprintAuth();
var observableModule = require("data/observable");
 
function pageLoaded(args) {
    var page = args.object;
    var data = new observableModule.Observable({authenticated: false});
    fingerprintAuth.available().then(function(avail) {
        if(avail) {
            fingerprintAuth.verifyFingerprint({
                message: "Scan with your finger",
                title: 'Android title'
            }).then(function() {
                data.authenticated = true;
            }, function(error) {
                console.log("Fingerprint NOT OK" + (error.code ? ". Code: " + error.code : ""));
            });
        }
    });
    page.bindingContext = data;
}
 
exports.pageLoaded = pageLoaded;

unique biometric ID associated with the fingerprint?

is there a way to return a unique biometric ID associated with the fingerprint?

for example? -

fingerprintAuth.available().then(
        function(avail) {
            fingerprintAuth.verifyFingerprint({
                  message: "Scan with your finger",
                  fallbackTitle: "Enter PIN"
              }).then(function() {
                  console.log("return....unique biometric ID?!"); // how do i return it? 
              }, function(error) {
                  console.log("error.....");
              });
        }
)

iOS "verifyFingerprintWithCustomFallback" resolves fail when attempting enter passcode

iOS "verifyFingerprintWithCustomFallback" resolves fail when attempting enter passcode (after a fail attempt of Fingerprint authentication).

Steps to reproduce:

  1. Have the Fingerprint authentication UI on screen
  2. Authenticate with an incorrect fingerprint, then "fallbackMessage" (i.e. Enter Passcode) shows up
  3. Click on the "Enter Passcode" (depends on the string of "fallbackMessage")
  4. Resolve as fail right the way (actual passcode screen never shown)

P.S. No issue when using "verifyFingerprint"

FYR
iOS 11.2.1 on 6 Plus
nativescript-fingerprint-auth 6.0.3
tns-ios 3.3.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.