# deviceAddTouchSensor

## Description

Adds touch sensor feature for the user's mobile device. To be able to use this function properly, the mobile device must have a touch sensor and the user must set up the fingerprint authentication in their device setting beforehand.

## Input / Parameter

| Name     | Description                                                             | Input Type  | Default | Options | Required |
| -------- | ----------------------------------------------------------------------- | ----------- | ------- | ------- | -------- |
| key      | The key in the device keychain.                                         | String/Text | -       | -       | Yes      |
| password | The password used to create the credential string for encrypted token.. | String/Text | -       | -       | Yes      |

## Output

N/A

## Callback

### callback

The function to be executed if touch sensor feature is added successfully.

## Video

Coming Soon.

## Example

The user wants to add touch sensor to their mobile device.

### Steps

| No. | Description                                                                                                                                                                                                               |                                                                                                                                                                       |
| --- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 1.  | ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-4d2ded128c568f68871c546e7deff977f9d7d418%2FdeviceAddTouchSensor-step-1.png?alt=media) | Drag a button component to a page in the mobile designer. Select the event `click` and drag the `deviceAddTouchSensor` function to the event flow.                    |
| 2.  | ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-977422cd3b16ac6d27aa28792c6bc7692344d90c%2FdeviceAddTouchSensor-step-2.png?alt=media) | Fill in the parameters of the function.                                                                                                                               |
| 3.  | ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-bc1e5dfdfbf453a41553408581844ddd312a0656%2FdeviceAddTouchSensor-step-3.png?alt=media) | Drag the function that is executed when the touch sensor feature is added to the mobile device successfully. In this example, we are using the `infoDialog` function. |
| 4.  | ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-dfc31b8c3cb2058472d4276217af175345754fca%2FdeviceAddTouchSensor-step-4.png?alt=media) | Fill in the parameters of the function.                                                                                                                               |

### Result

When the button is pressed, the mobile device will ask for fingerprint authentication. Touch the touch sensor of the device for the fingerprint to be recognized. The dialog will show the input passed.

## Links
