Skip to content
Allow users to authenticate with Face ID or Touch ID on iOS devices
Swift Ruby TypeScript Objective-C JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/ISSUE_TEMPLATE Update issue templates Sep 15, 2019
docs
ios docs(readme): update readme Sep 15, 2019
src docs: rework interfaces Sep 16, 2019
.gitignore chore: update .gitignore Sep 15, 2019
.travis.yml chore: add travis Sep 15, 2019
CHANGELOG.md 1.0.2 Oct 15, 2019
CapacitorFaceId.podspec Initial commit Sep 15, 2019
LICENSE.md Initial commit Sep 15, 2019
README.md docs(readme): update readme Sep 15, 2019
package-lock.json 1.0.2 Oct 15, 2019
package.json
rollup.config.js Initial commit Sep 15, 2019
tsconfig.json Initial commit Sep 15, 2019

README.md

Capacitor Face ID Plugin

npm version Build Status

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

Logo

Instalation

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: boolean }> Checks if Face ID or Touch ID is available
auth(options?: {reason?: string}) options: {reason: "Access requires authentication"} Promise<void> Displays the Face ID or Touch ID screen
You can’t perform that action at this time.