Open thandang opened 1 year ago
I solved this issue using AppStorage(Local DB).
Thanks for the question and the reply. @Eunno-An Could you give us an example so maybe I could add it to the package?
@thandang We are using WalletConnect V1 so possibly this is a feature that you need to request in their repo https://github.com/WalletConnect/WalletConnectSwift
@thandang @maurovz Sorry for checking late.My solution is simple.
I will introduce LoginView first.
@AppStorage("walletAddress") var address: String = UserDefaults.standard.string(forKey: "walletAddress") ?? ""
Check "walletAddress" using if - else.
and inside the WalletButtonView code block, write below code in success code block.
address = user.wallet.address
And Secondly, logoutButton onTapGesture, init address tag in localDB.
If you have any questions, please feel free to ask. As much as I have been helped, I hope to help others as well.
Another Strategy is Using AWS Cognito service. You can use wallet address to nickname that cannot be duplicated.
Thank you
@thandang @maurovz Sorry for checking late.My solution is simple.
I will introduce LoginView first.
@AppStorage("walletAddress") var address: String = UserDefaults.standard.string(forKey: "walletAddress") ?? ""
Check "walletAddress" using if - else.
and inside the WalletButtonView code block, write below code in success code block.
address = user.wallet.address
And Secondly, logoutButton onTapGesture, init address tag in localDB.
If you have any questions, please feel free to ask. As much as I have been helped, I hope to help others as well.
I will try to test this. Thanks!
Another Strategy is Using AWS Cognito service. You can use wallet address to nickname that cannot be duplicated.
Thank you
I'd prefer people are not dependant on more 3rd party services. At the same time, we could add optional sub packages in the future.
What I did is stored the session whenever it's connected. We might have more than one sessions. So, the key should be send from the app as parameter instead of sdk. Whenever user launch the app (like first open or kill, open again), we will check and reconnect.
Another Strategy is Using AWS Cognito service. You can use wallet address to nickname that cannot be duplicated. Thank you
I'd prefer people are not dependant on more 3rd party services. At the same time, we could add optional sub packages in the future.
Thanks to reply But AppStorage solution have serious problem some cases. If i edit the wallet address in my local file, and using this glaip package for another service, the result might be wrong.
So , like AWS Cognito, 3rd party service should be needed especially keeping session issue. Thanks
Thanks for the project. I found that there is no storage on connection. Which means if I connected. Kill the app and open again, the connection session is lost. Can we keep it?
Thanks in advance.