Comments (11)
For me it was importing using:
import TouchID from "react-native-touch-id";
did the trick. Needed to be using the es2015 syntax...smh
from react-native-touch-id.
Run the following.
react-native link
https://github.com/naoufal/react-native-touch-id#linking-the-library
from react-native-touch-id.
Using version 4.0.0, I still get the same error after linking and using the import syntax.
import React from "react"
import TouchID from 'react-native-touch-id'
import { View, TouchableHighlight, Text, Alert } from 'react-native'
type Props = {
};
const optionalConfigObject = {
title: "Authentication Required",
color: "#e00606"
}
export default class TouchIdTest extends React.Component<Props> {
componentDidMount() {
TouchID.isSupported()
.then(supported => {
console.log('it is supported');
})
.catch(err => {
console.log(err.message);
})
}
_pressHandler() {
TouchID.authenticate('to demo this react-native component', optionalConfigObject)
.then(success => {
Alert.alert('Info', 'Authenticated Successfully');
})
.catch(error => {
Alert.alert('Error', 'Authentication Failed '+error);
});
}
render() {
return (
<View>
<TouchableHighlight onPress={this._pressHandler}>
<Text>
Authenticate with Touch ID
</Text>
</TouchableHighlight>
</View>
);
}
};
I get the error "Cannot read property 'isSupported' of indefined.
And it I press the button, I get "Authentication Failed TypeError: Cannot read property 'authenticate' of undefined".
from react-native-touch-id.
OS: Linux
Device: Android Emulator
I could solve this problem by inspecting the TouchID object and realizing that to call the functions isSupported()
or authenticate("foo")
a further key must be accessed:
TouchID.default.isSupported().then(...)
and TouchID.default.authenticate("foo").then(...)
from react-native-touch-id.
Open Xcode and check if Header Search Paths and make sure it contains $(SRCROOT)/../../../react-native/React
as recursive in Build Phase. Solve the problem for me (RN 0.44)
from react-native-touch-id.
I tried running react-native link, linked fine, via @GentryRiggen
I also tried adding the header search paths like @gigeos suggested (this should not be necessary if only using in js code right?)...
Still getting this error:
TouchID.isSupported is not a function. (In 'TouchID.isSupported()', 'TouchID.isSupported' is undefined)
Any other ideas?
TouchID.isSupported is not a function. (In 'TouchID.isSupported()', 'TouchID.isSupported' is undefined)
nextStep
signUp.js:39:8
onPress
signUp.js:103:61
touchableHandlePress
TouchableOpacity.js:126:45
_performSideEffectsForTransition
Touchable.js:746:34
_receiveSignal
Touchable.js:664:44
touchableHandleResponderRelease
Touchable.js:433:24
invokeGuardedCallback
ReactErrorUtils.js:22:15
invokeGuardedCallbackAndCatchFirstError
ReactErrorUtils.js:133:62
executeDispatch
EventPluginUtils.js:90:4
executeDispatchesInOrder
EventPluginUtils.js:121:20
executeDispatchesAndRelease
EventPluginHub.js:37:46
forEachAccumulated
forEachAccumulated.js:30:16
processEventQueue
EventPluginHub.js:233:8
runEventQueueInBatch
ReactEventEmitterMixin.js:18:35
handleTopLevel
ReactEventEmitterMixin.js:38:25
<unknown>
ReactNativeEventEmitter.js:107:8
perform
Transaction.js:150:24
batchedUpdatesWithControlledComponents
ReactGenericBatching.js:51:26
_receiveRootNodeIDEvent
ReactNativeEventEmitter.js:105:40
receiveTouches
ReactNativeEventEmitter.js:193:8
__callFunction
MessageQueue.js:250:47
<unknown>
MessageQueue.js:101:26
__guard
MessageQueue.js:218:6
callFunctionReturnFlushedQueue
MessageQueue.js:100:17
from react-native-touch-id.
I'm closing this since it seems like @klivin 's issue is solved, and the original author of this issue has never responded.
from react-native-touch-id.
No body solved this problem?
from react-native-touch-id.
Anyone know of a fix for this issue??
from react-native-touch-id.
import TouchID from "react-native-touch-id";
works fine, although with typescript and tsconfig set to
"compilerOptions": { "allowSyntheticDefaultImports": false }
I'm getting this error:
Error:(16, 8) TS1192: Module ''react-native-touch-id'' has no default export.
from react-native-touch-id.
I'm still receiving this error on Android using version 4.0.4 and everything appears to be linked correctly.
at TouchID.android.js:8
at tryCallTwo (core.js:45)
at doResolve (core.js:200)
at new Promise (core.js:66)
at Object.isSupported (TouchID.android.js:7)
at SecuritySettingsScreen.syncPreferences (SecuritySettingsScreen.js:137)
at new SecuritySettingsScreen (SecuritySettingsScreen.js:106)
at constructClassInstance (ReactNativeRenderer-dev.js:6729)
at updateClassComponent (ReactNativeRenderer-dev.js:8810)
at beginWork (ReactNativeRenderer-dev.js:9646)
at performUnitOfWork (ReactNativeRenderer-dev.js:12361)
at workLoop (ReactNativeRenderer-dev.js:12384)
at renderRoot (ReactNativeRenderer-dev.js:12427)
at performWorkOnRoot (ReactNativeRenderer-dev.js:13034)
at performWork (ReactNativeRenderer-dev.js:12951)
at performSyncWork (ReactNativeRenderer-dev.js:12913)
at requestWork (ReactNativeRenderer-dev.js:12799)
at scheduleWorkImpl (ReactNativeRenderer-dev.js:12666)
at scheduleWork (ReactNativeRenderer-dev.js:12622)
at scheduleRootUpdate (ReactNativeRenderer-dev.js:13324)
at _updateContainerAtExpirationTime (ReactNativeRenderer-dev.js:13359)
at Object.updateContainer (ReactNativeRenderer-dev.js:13384)
at Object.render (ReactNativeRenderer-dev.js:14119)
at renderApplication (renderApplication.js:58)
at Object.run (AppRegistry.js:103)
at Object.runApplication (AppRegistry.js:196)
at MessageQueue.__callFunction (MessageQueue.js:353)
at MessageQueue.js:118
at MessageQueue.__guardSafe (MessageQueue.js:316)
at MessageQueue.callFunctionReturnFlushedQueue (MessageQueue.js:117)
at debuggerWorker.js:72
from react-native-touch-id.
Related Issues (20)
- Is there a way to save the Touch ID string to Keystore?
- lost text,messages
- how to check touch id inside screen HOT 1
- Is it valid for expo? HOT 1
- TypeError: Cannot read property 'isSupported' of undefined HOT 5
- Do not use this library in sensitive applications HOT 2
- can't seem to get the error of unmatched finger print
- Android Face ID never working. HOT 5
- Hide dialog window on android if native dialog is opening
- Compile time error in react-native-web-app HOT 1
- Is this package still going to be maintained HOT 5
- Increase the number of authentication attempts to 4 or 5 times instead of 2 (IOS)
- passcodeFallback related issue HOT 2
- How To Detecting FaceID/TouchID Were Have Changed
- IS this package being maintained now? HOT 2
- How to get the number of fingerprint registrations?
- Error : LAErrorAuthenticationFailed Authentication could not start because Touch ID has no enrolled fingers.
- Reac-native-touch-id doesn't recognize faceid in android 10 and above. HOT 2
- Support new React Native new architecture (TurboModules/Fabric) HOT 1
- How can i change touch id modal UI HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-touch-id.