1.2.5 • Published 6 years ago
react-native-fingerprint-change v1.2.5
react-native-fingerprint-change
Getting started
$ npm install react-native-fingerprint-change --save
Mostly automatic installation
$ react-native link react-native-fingerprint-change
Manual installation
iOS
- In XCode, in the project navigator, right click
Libraries➜Add Files to [your project's name] - Go to
node_modules➜react-native-fingerprint-changeand addRNFingerprintChange.xcodeproj - In XCode, in the project navigator, select your project. Add
libRNFingerprintChange.ato your project'sBuild Phases➜Link Binary With Libraries - Run your project (
Cmd+R)<
Android
- Open up
android/app/src/main/java/[...]/MainApplication.java
- Add
import com.toyberman.fingerprintChange.RNFingerprintChangePackage;to the imports at the top of the file - Add
new RNReactNativeAccessibilityPackage()to the list returned by thegetPackages()method
- Append the following lines to
android/settings.gradle:include ':react-native-fingerprint-change' project(':react-native-fingerprint-change').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fingerprint-change/android') - Insert the following lines inside the dependencies block in
android/app/build.gradle:compile project(':react-native-fingerprint-change')
Usage
import RNFingerprintChange from 'react-native-fingerprint-change';
// How to use the module
RNFingerprintChange.hasFingerPrintChanged((error, fingerprintHasChanged)=>{
if(fingerprintHasChanged) {
// do what you need when fingerprint change has been detected
}
})
example:
import {
AppState,
} from 'react-native';
import RNFingerprintChange from 'react-native-fingerprint-change';
class example extends Component {
constructor(props) {
super(props)
this.state = {
appState: AppState.currentState,
}
}
componentDidMount() {
AppState.addEventListener('change', this._handleAppStateChange);
}
componentWillUnmount() {
AppState.removeEventListener('change', this._handleAppStateChange);
}
_handleAppStateChange = (nextAppState) => {
if (this.state.appState.match(/inactive|background/) && nextAppState === 'active') {
//App has come to the foreground!
RNFingerprintChange.hasFingerPrintChanged((error) => {},(fingerprintHasChanged)=>{
if(fingerprintHasChanged) {
// do what you need
}
})
}
this.setState({appState: nextAppState});
}
}1.2.5
6 years ago
1.2.4
6 years ago
1.2.3
6 years ago
1.2.2
6 years ago
1.2.1
6 years ago
1.2.0
6 years ago
1.1.5
7 years ago
1.1.4
7 years ago
1.1.3
7 years ago
1.1.2
7 years ago
1.1.1
7 years ago
1.1.0
7 years ago
1.0.9
7 years ago
1.0.8
7 years ago
1.0.7
7 years ago
1.0.6
8 years ago
1.0.5
8 years ago
1.0.4
8 years ago
1.0.3
8 years ago
1.0.2
8 years ago
1.0.1
8 years ago
1.0.0
8 years ago