import React, { Component } from 'react'; import { AlertIOS, StyleSheet, Text, TouchableHighlight, View, NativeModules } from 'react-native'; import TouchID from 'react-native-touch-id' class FingerPrint extends React.Component { //config is optional to be passed in on Android const optionalConfigObject = { title: "Authentication Required", // Android color: "#e00606", // Android, fallbackLabel: "Show Passcode" // iOS (if empty, then label is hidden) } pressHandler() { TouchID.authenticate('to demo this react-native component', optionalConfigObject) .then(success => { AlertIOS.alert('Authenticated Successfully'); }) .catch(error => { AlertIOS.alert('Authentication Failed'); }); } render() { return ( Authenticate with Touch ID ); } };