An open API service indexing awesome lists of open source software.

https://github.com/rightpoint/react-native-touch-sensor


https://github.com/rightpoint/react-native-touch-sensor

Last synced: about 1 year ago
JSON representation

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