Coder Social home page Coder Social logo

danielsogl / capacitor-face-id Goto Github PK

View Code? Open in Web Editor NEW
104.0 3.0 11.0 3.95 MB

Allow users to authenticate with Face ID or Touch ID on iOS devices

Home Page: https://danielsogl.github.io/capacitor-face-id/

License: MIT License

Ruby 15.44% Objective-C 12.94% Swift 51.26% JavaScript 4.72% TypeScript 15.64%
capacitor capacitor-plugin ionic ios face-id touch-id

capacitor-face-id's Introduction

Capacitor Face ID Plugin

npm version Build

Allow users to authenticate with Face ID or Touch ID on iOS devices

Logo

Installation

npm install capacitor-face-id

iOS Notes

iOS requires the following usage description be added and filled out for your app in Info.plist:

Name: Privacy - Face ID Usage Description
Key: NSFaceIDUsageDescription

Example

import { Plugins, PluginResultError } from '@capacitor/core';

const { FaceId } = Plugins;

...
// check if device supports Face ID or Touch ID
FaceId.isAvailable().then(checkResult => {
  if(checkResult.value) {
    FaceId.auth().then(() => {
      console.log('authenticated');
    }).catch((error: PluginResultError) => {
      // handle rejection errors
      console.error(error.message);
    });
  } else {
    // use custom fallback authentication here
  }
});

API

Method Default Type Description
isAvailable() Promise<{ value: string }> Checks if Face ID or Touch ID is available, and returns type if so.
auth(options?: {reason?: string}) options: {reason: "Access requires authentication"} Promise<void> Displays the Face ID or Touch ID screen

capacitor-face-id's People

Contributors

actions-user avatar danielsogl avatar dependabot-preview[bot] avatar dependabot[bot] avatar mkw2000 avatar renovate-bot avatar renovate[bot] 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

capacitor-face-id's Issues

Face ID does not work as expected

When I call auth() it works well the first time. But when I call it again after the user left and came back to the app, the authentication is done automatically, even if my face is not in the front of the camera anymore. How can I force to to the check properly?

editor

kindly tell me how can i run this project?
in xcode only the ios folder is opening and the build is unsuccessful.
in VS code all the files are opening but i can't run the project in simulator.

capacitor v3

Describe the bug

missing version for capacitor 3
cannot compile with it
To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.
Screenshot 2021-11-17 at 22 57 53

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

cocoapods
ios/Podfile
github-actions
.github/workflows/build.yml
  • actions/checkout v3
  • actions/setup-node v3.4.1
.github/workflows/npmpublish.yml
  • actions/checkout v3
  • actions/setup-node v3.4.1
  • actions/checkout v3
  • actions/setup-node v3.4.1
npm
package.json
  • @capacitor/core ^2.5.0
  • @capacitor/ios 2.5.0
  • conventional-changelog-cli 2.2.2
  • typedoc 0.23.9
  • typescript 4.7.4

  • Check this box to trigger a request for Renovate to run again on this repository

Native OS UI does not always display

Describe the bug
First off, great plugin. Clean and concise. Simply gets the job done. Could use some documentation on error responses from promises, and options in FaceId.auth. What I am currently experiencing is that the native os UI (modal?) does not consistently display on first invocation of FaceId.auth(options);. Clearly something is running under the hood, for when I touch the touchID button, the native layer either accepts or rejects the fingerprint and appropriately (and consistently) displays the native os UI.

To Reproduce
Steps to reproduce the behavior:
invoke FaceId.auth(options); with angular 8 (click)="" handler on an HTML button element.

Expected behavior
A consistent display of the native os UI on the first invocation of FaceId.auth(options);

Screenshots
n/a

Smartphone (please complete the following information):

  • Device: iPad (6th generation)
  • OS: iPadOS 13.1.2

Additional context
n/a

Android support

Great work! Would it be possible for you to make it available for Android as well? At least the fingerprint.

Patch for compiling on xcode 15 ios 17

After updating to xcode15, latest capacitor version, ios 17 etc...

=> the plugin returned an error when compiling in Xcode saying:

Switch must be exhaustive.

I could compile with this patch:

diff --git a/node_modules/capacitor-face-id/ios/Plugin/Plugin.swift b/node_modules/capacitor-face-id/ios/Plugin/Plugin.swift
index 3c7bb8a..48642fe 100644
--- a/node_modules/capacitor-face-id/ios/Plugin/Plugin.swift
+++ b/node_modules/capacitor-face-id/ios/Plugin/Plugin.swift
@@ -27,6 +27,10 @@ public class FaceId: CAPPlugin {
                 call.success([
                     "value": "FaceId"
                 ])
+            @unknown default:
+                call.success([
+                    "value": "Unknown"
+                ])
             }
         } else {
             call.success([

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.