PhoneGap - TouchID/FaceID

Description

Adds TouchID/FaceID functionality to a mobile app built using Cordova.

Discussion

On some iOS devices, TouchID and FaceID can be used to authenticate the user before allowing them to use the app. The PhoneGap - TouchID/FaceID Action Javascript action makes it easy to test for and utilize TouchID or FaceID in a Cordova application to verify the user's credentials before allowing them to access the application.

images/pgTouch1.png

Properties

The PhoneGap TouchId/FaceId Login action is configured using the following properties:

  • Type

    The action to perform. The action can be one of the following:

    Type
    Description
    VerifyAvailable

    Checks to see if TouchID or FaceID is available on the device.

    Login

    Activates TouchID or FaceID to perform a login.

  • Message

    The message shown on the fingerprint scanner. This option is only available if Type has been set to "Login".

  • onSuccess

    An event that contains JavaScript to execute if the operation succeeds.

    If the Type is set to "VerifyAvailable", the onSuccess event will be executed if TouchID or FaceID is available on the device.

    If the Type is set to "Login", the onSuccess event is executed if login succeeds.

  • onFailed

    An event that contains JavaScript to execute if the operation fails.

    If the Type is set to "VerifyAvailable", the onFailed event will be executed if TouchID or FaceID is not available on the device.

    If the Type is set to "Login", the onFailed event is executed if login fails -- either because the user failed to provide valid credentials or the action was cancelled.

Limitations

Cordova Applications Only