Hi, I am using Tkey JS SDK with Sfa service prodvider in React Native app. I follow the docs and get stuck, here is my step.
First, user login with google, I got idToken and use tKey.serviceProvider.connect to verify, then I call tKey.initialize().
tkey.getKeyDetails() return requiredShare is 1, totalShares is 2.
I cannot ReconstructKey because it tell me I need 1 more share, but I dont know how to get 2-nd share. In case user siginin the first time, no share from storage or security questions… had been created before.
Please provide the following details too when asking for help in this category:
Hello @cuongnguyen
It probably worked fine the very first time you initialized it, since when the first time tkey is initialized, both share A and B (device Share, social login Share) are generated.
the reason why you can’t initialize next time is that you can’t load the device Share you created before.
when tkey.getKeyDetails() return 1 in second time is that it only returns social login share but not device Share.
To prevent this, you need to load the device share.
try using web storage module or react native storage to store and load device Share