react-native-touch-id-value

React Native Apple TouchID bridge for storing and retrieving fingerprint protected values

Usage no npm install needed!

<script type="module">
  import reactNativeTouchIdValue from 'https://cdn.skypack.dev/react-native-touch-id-value';
</script>

README

react-native-touch-id-value

Saving and retrieving Apple TouchID protected values. Useful for storing essential authentication information.

Usage (iOS)

Install npm package:

npm install react-native-touch-id-value --save

Add links to the library:

react-native link react-native-touch-id-value

Make sure RNTouchIDValue.xcodeproj appeared in "Libraries" in your application XCode project and that libRNTouchIDValue.a is present in "Project properties" - "Targets" - "" - "Build Phases" - "Link Binary With Libraries".

Example

import { observable, action } from 'mobx';
import TouchID from 'react-native-touch-id-value';

const touchid = observable({
    available: false,

    @action async load() {
        this.available = await TouchID.isFeatureAvailable();
    },

    @action save(key, value) {
        return TouchID.save(value, key);
    },

    @action get(key) {
        return TouchID.get(key);
    }
});

export default touchid;

TouchID.isFeatureAvailable()
    .then(result => {
        console.log(`touchid-bridge.js: ${result}`);
    });