Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SwitchNetwork fails on iOS and Android when wallet is connected from app on the same device. #230

Open
GlennHodges27 opened this issue Feb 24, 2025 · 1 comment
Assignees

Comments

@GlennHodges27
Copy link

GlennHodges27 commented Feb 24, 2025

I'm using SwitchNetwork exactly as it is shown in your docs...

await wallet.SwitchNetwork(chainId);

Im seeing some odd behaviour depending on how I connect to the wallet using the ThirdwebManager and WalletConnectWallet.

If I connect to a wallet using the QR code option and scan from a second device the connection happens as expected and SwitchNetwork works as expected as many times as I try it. It switches network in the wallet on the other device and the SwitchNetwork call completes as expected in my app once the network is switched.

If I connect using a wallet on the same device that my app is running on the connection happens as expected but when I call SwitchNetwork there is a problem. The wallet does switch network as expected but the SwitchNetwork call doesn't complete, it seems to just sit forever waiting for a response.

I have tried this on both Android and iOS using multiple networks and wallets and it always fails.

I was using an older SDK but I have updated to the latest one (v5.18.1) and the problem remains.

I've also tried this in a brand new Unity project that does nothing but a connect and switch and the problem still remains.

Edit: This first instance is true if the wallet app connected to via QR code doesn't also exist on the device with my app. If the wallet app does exist it connects on the 2nd device as expected. When SwitchNetwork is called it switches the network in the wallet on the 2nd device as expected but also launches the wallet on the device running my app and I assume tries to do it there as well. Which results in the same problem occurring, the call to SwitchNetwork waits forever for a response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants