I am trying to create a device share , export it as a file as well and then use it in case user user doesnot have other shares. I follow the docs , use the react native storage module to store this device share.
// creating and storing the device share
const newShare = await tKey.generateNewShare();
const share = await tKey.outputShareStore(newShare.newShareIndex);
await(tKey.modules.reactNativeStorage as ReactNativeStorageModule).storeDeviceShare(share);
// input the device share in tKey
await tKey.inputShareStore(share);
When i import the file and get the share from there and import that share in tKey on a different device. Then it does import it and gives no error but when i call
Key.getKeyDetails() ;
I still see the required shares as 1. So i am unable to import this device share from a file into another device to recreate the private key. Is this the expected behaviour ? If yes , how can we use this module such that we are able to use this device share , export it as a file and use it on multiple devices ?
Sorry for the delay in responding from my end. Can I know how are you exporting the share as a file on another device? The device share on React Natice storage module is only meant to store a newly generated share on a device and use it there itself. It is using React Native encrypted storage and hence moving it manually to another device won’t work.
If you wanna access on another device, the best way is the use any recovery method like SMS OTP, Passkeys, Password etc. You can also use the share transfer module where using network calls you can transfer a share from one device to another.