Skip to content

Instantly share code, notes, and snippets.

@adhithiravi
Last active July 28, 2019 21:12
Show Gist options
  • Save adhithiravi/e35ae58a1ddcc2b95e65b3bdd899ca6c to your computer and use it in GitHub Desktop.
Save adhithiravi/e35ae58a1ddcc2b95e65b3bdd899ca6c to your computer and use it in GitHub Desktop.

Revisions

  1. adhithiravi revised this gist Sep 30, 2018. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion FingerPrint.js
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,8 @@ import {
    TouchableHighlight,
    View,
    NativeModules
    }
    } from 'react-native';

    import TouchID from 'react-native-touch-id'

    class FingerPrint extends React.Component {
  2. adhithiravi revised this gist Sep 19, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion FingerPrint.js
    Original file line number Diff line number Diff line change
    @@ -16,7 +16,7 @@ class FingerPrint extends React.Component {
    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)
  3. adhithiravi revised this gist Sep 19, 2018. 1 changed file with 7 additions and 0 deletions.
    7 changes: 7 additions & 0 deletions FingerPrint.js
    Original file line number Diff line number Diff line change
    @@ -10,6 +10,13 @@ import {
    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)
  4. adhithiravi revised this gist Sep 19, 2018. No changes.
  5. adhithiravi renamed this gist Sep 19, 2018. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  6. adhithiravi created this gist Sep 19, 2018.
    35 changes: 35 additions & 0 deletions FingPrint.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,35 @@
    import React, { Component } from 'react';
    import {
    AlertIOS,
    StyleSheet,
    Text,
    TouchableHighlight,
    View,
    NativeModules
    }
    import TouchID from 'react-native-touch-id'

    class FingerPrint extends React.Component {

    pressHandler() {
    TouchID.authenticate('to demo this react-native component', optionalConfigObject)
    .then(success => {
    AlertIOS.alert('Authenticated Successfully');
    })
    .catch(error => {
    AlertIOS.alert('Authentication Failed');
    });
    }

    render() {
    return (
    <View>
    <TouchableHighlight onPress={this.pressHandler}>
    <Text>
    Authenticate with Touch ID
    </Text>
    </TouchableHighlight>
    </View>
    );
    }
    };