Issue
I have a Cordova based mobile application in which some data were saved on the device using cordova-plugin-secure-storage. For example:
var ss = new cordova.plugins.SecureStorage(
function() {
console.log("Success");
},
function(error) {
console.log("Error " + error);
},
"my_namespace"
);
Where my_namespace indicates the namespaced secure storage used by plugin.
Now I have to write a new version of this mobile application, but using React Native instead of Ionic Cordova. The problem is that I need to still access the Secure Storage data of the previous application. There are some React Native plugins that are similar to cordova-plugin-secure-storage that allow me to access to the namespaced Secure Storage?
Solution
You could fetch your web kit local storage using this module react-native-webkit-localstorage-reader
But the module which you used, seems to be use sharedPreference on android and keychain for iOS so you may need to fetch data from those places. My suggestion is to write your own native module using same functionality of cordova-plugin-secure-storage in react native. In this way you will be able use same secure storage if you wish to continue with your react native app also if not in initial react native app release you could migrate all of your data to React Native Async Storage
Helpful reference for making native module:
Creating a Native Module in React Native
Note : Your data was encrypted, So you may need to use same decryption functionality which was used in your previous module.
Answered By - EL173
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.