Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_reactNativeSensitiveInfo.default.getItem is not a function (it is undefined) #424

Open
alimoli opened this issue Nov 18, 2024 · 3 comments

Comments

@alimoli
Copy link

alimoli commented Nov 18, 2024

Dependencies

"react": "18.2.0",
"react-native": "0.76.1",
"react-native-sensitive-info": "^5.5.8",

Error on iOS (18.1) (via Metro and simulator)

 _reactNativeSensitiveInfo.default.getItem is not a function (it is undefined)

All the methods related to items are not available on iOS.
Working on Android.

@AtesDANIS
Copy link

AtesDANIS commented Nov 20, 2024

same here on android 🤷
image

@jsreynaud
Copy link

This module use old Android/iOS Native Modules. This is deprecated in favor of Turbo Native Module and Fabric Native Components
https://reactnative.dev/docs/legacy/native-modules-android

This module should be refactored/refreshed...
Anyway other up-to-date projects should propose the same features (example https://github.com/oblador/react-native-keychain)

@jsreynaud
Copy link

You can also modify yourself the file RNSensitiveInfo.js to fix for new architecture (backport of this commit:
exPivot@d304a13)

I do that on my side and use https://github.com/ds300/patch-package to maintain in my app...

import { NativeModules } from 'react-native';

const RNSensitiveInfo = NativeModules.RNSensitiveInfo;

RNSensitiveInfo.setInvalidatedByBiometricEnrollment = (
  invalidatedByBiometricEnrollment,
) => {
  if (RNSensitiveInfo.setInvalidatedByBiometricEnrollment == null) {
    return undefined;
  }

  return RNSensitiveInfo.setInvalidatedByBiometricEnrollment(
    invalidatedByBiometricEnrollment,
  );
};
RNSensitiveInfo.cancelFingerprintAuth = () => {
  if (RNSensitiveInfo.cancelFingerprintAuth == null) {
    return undefined;
  }

  return RNSensitiveInfo.cancelFingerprintAuth();
};
export default RNSensitiveInfo;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants