Open donzthefonz opened 4 years ago
Please provide a PR for that. Im facing the same issue.
This worked for me (using react-native-pincode
which relies on this). Please PR so that other repos that depend on this get the change!
Someone in the project can PR this pls ?
Please?!?!!
react-native-keychain+6.2.0.patch
diff --git a/node_modules/react-native-keychain/index.js b/node_modules/react-native-keychain/index.js
index e81235e..d412ebe 100644
--- a/node_modules/react-native-keychain/index.js
+++ b/node_modules/react-native-keychain/index.js
@@ -4,9 +4,9 @@ import { NativeModules, Platform } from 'react-native';
const { RNKeychainManager } = NativeModules;
export const SECURITY_LEVEL = Object.freeze({
- ANY: RNKeychainManager.SECURITY_LEVEL_ANY,
- SECURE_SOFTWARE: RNKeychainManager.SECURITY_LEVEL_SECURE_SOFTWARE,
- SECURE_HARDWARE: RNKeychainManager.SECURITY_LEVEL_SECURE_HARDWARE,
+ ANY: RNKeychainManager && RNKeychainManager.SECURITY_LEVEL_ANY,
+ SECURE_SOFTWARE: RNKeychainManager && RNKeychainManager.SECURITY_LEVEL_SECURE_SOFTWARE,
+ SECURE_HARDWARE: RNKeychainManager && RNKeychainManager.SECURITY_LEVEL_SECURE_HARDWARE,
});
export const ACCESSIBLE = Object.freeze({
please fix. thanks
Actually I move to https://docs.expo.io/versions/latest/sdk/securestore/ until this is not fixed. :'(
Any one of you people asking for a PR could make the PR for this. Take the time to support the library and make this PR. It's a great library and I'm sure it would be helpful :).
Submitted pull request with the suggested fix
Was this your error?: null is not an object (evaluating 'RNKeychainManager.SECURITY_LEVEL_ANY')
I got this error and fixed it per https://github.com/oblador/react-native-keychain/issues/388
You need to change a line within react-native-keychain, but it's within the node_modules directory of react-native-pincode which is itself within your own app's node_modules. So it took me a bit of poking around to find it.
change directories into node_modules/\@haskkor/react-native-pincode/node_modules/react-native-keychain/ open index.js with your favorite editor
Replace the follow line, which is contained within export const SECURITY_LEVEL = Object.freeze({...}); : ANY: RNKeychainManager.SECURITY_LEVEL_ANY,
with
ANY: RNKeychainManager && RNKeychainManager.SECURITY_LEVEL_ANY,
and don't change anything else.
It looks like this needs to be PR'd into react-native-keychain so that it becomes a permanent fix. (I believe reinstalling node_modules will undo your local changes).
For development purposes, this short-term fix worked for me.
Was struggling with some errors like:
TypeError: Cannot read property 'SECURITY_LEVEL_ANY' of undefined
ornull is not an object (evaluating 'RNKeychainManager.SECURITY_LEVEL_ANY')
(like https://github.com/oblador/react-native-keychain/issues/221)The problem is within index.js:
It's not safe and should be changed to: