https://github.com/rightpoint/react-native-touch-sensor
https://github.com/rightpoint/react-native-touch-sensor
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/rightpoint/react-native-touch-sensor
- Owner: Rightpoint
- License: apache-2.0
- Created: 2017-05-25T19:49:18.000Z (about 9 years ago)
- Default Branch: develop
- Last Pushed: 2018-01-05T12:23:03.000Z (over 8 years ago)
- Last Synced: 2025-02-16T00:48:12.738Z (over 1 year ago)
- Language: Java
- Size: 1.09 MB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# react-native-touch-sensor
Bridging for accesing the Touch Sensor on both iOS and Android using TouchID and Android Fingerprint
# Installation
`npm install -s react-native-touch-sensor`
`react-native link react-native-touch-sensor`
# Android Setup
Be sure to add the Fingerprint permission to your `AndroidManaifest.xml` file
``
Currently `react-native-touch-sensor` requires Android sdk 23 to work. Update this in your `app.gradle` file
# Example
```
import React, { Component } from 'react'
import { View, Text, Button } from 'react-native'
import Touch from 'react-native-touch-sensor'
export default class TouchExample extends Component {
_isSupported() {
Touch.isSupported()
.then( () => alert('Android fingerprint supported'))
.catch( (error) => alert(`unsupported: ${error}`))
}
_authenticatePressed() {
Touch.authenticate("To test out the app")
.then( () => alert('authenticated') )
.catch( (error) => alert(`Failed: ${error}`) )
}
render() {
return (
Check to see if all conditions are met to use Fingerprint
this._isSupported()}
/>
Begins Authentication process
this._authenticatePressed()}
/>
);
}
}
```
# Reference:
TouchID: https://github.com/naoufal/react-native-touch-id
AndroidFingerprint: https://github.com/googlesamples/android-FingerprintDialog
https://github.com/jariz/react-native-fingerprint-android
https://material.io/guidelines/patterns/fingerprint.html#fingerprint-enrollment