React-Native newbie here running into problems and wondering if I have missed a fundamental step in the installation of packages.
I have been trying to use the react-native-rsa-native package (https://github.com/amitaymolko/react-native-rsa-native)
However I am getting
TypeError: undefined is not an object (evaluating '_reactNativeRsaNative.RSA.generateKeys')
My test code is:
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { RSA, RSAKeychain } from 'react-native-rsa-native';
export default class App extends React.Component {
componentWillMount() {
RSA.generateKeys(4096) // set key size
.then(keys => {
console.log('4096 private:', keys.private) // the private key
console.log('4096 public:', keys.public) // the public key
});
}
render() {
...
}
}
The steps followed were:
expo init rsatest --template blank@sdk-31 --yarn
cd rsatest
yarn add react-native-rsa-native
react-native link react-native-rsa-native
yarn start
The react-native-rsa-native package does appear in the node_modules directory however I feel I am missing something.
Any ideas?