rainbowkit
rainbowkit copied to clipboard
[bug] Network Switcher doesn't show and work on Android
Is there an existing issue for this?
- [X] I have searched the existing issues
RainbowKit Version
1.0.5
wagmi Version
1.0.9
Current Behavior
When I choose the Mumbai network on Android MetaMask and click on the ConnectButton, it connects properly. However, it does not indicate that the network is incorrect (Polygon Mainnet is the default and only network).
Sometimes when I switch back to MetaMask and reopen Chrome, it detects the wrong network, and the ConnectButton changes to red. It appears that the state of this button doesn't update when MetaMask redirects back to the app.
Moreover, when I click on the "Wrong network" button, it properly displays a modal, and I can click "Polygon." But it does not open MetaMask to change this network; in fact, nothing happens.
Expected Behavior
- The button status should change to "Wrong network" immediately after being redirected back from MetaMask post-connection on Android.
- When I click on "Polygon network" in the Switch Network modal, it should redirect me to MetaMask and change the network to the selected one. If someone doesn't have this network added to MetaMask, it should automatically add it.
Steps To Reproduce
No response
Link to Minimal Reproducible Example (CodeSandbox, StackBlitz, etc.)
No response
Anything else?
No response
Hey @mzspcgg. For me the android behaviour works fine. It changes to "Wrong network" if it's unsupported right after MetaMask post connection on android + switching chains works fine even if you have them or not.
Do you have a reproducible example of this where i can test this behaviour ?
Hello I am getting exactly the same error and ever stranger.
I'm currently working on integrating Metamask with my DApp using RainbowKit and Wagmi. I'm encountering a peculiar issue. In my configuration, I've specified only the Polygon Mumbai chain, which isn't added to my Metamask. However, after connecting through the Connect button and confirming in Metamask, my website displays a message stating that I am connected to the Mumbai network, even though it's not present in my wallet.
I'm seeking assistance to troubleshoot this problem. Can you please contact me via Telegram to talk I details about this problem, please?
My Telegram https://t.me/dmykovI
I can replicate this issue now. This seems to be issue with walletconnect linking on mobile. Will take closer look and update once it's been resolved 🙏
@mzspcgg Just got informed from WalletConnect that it's a normal issue from metamask. Since they are a single chain wallet they have some bugs on their end. Will keep this issue open until it's resolved on their end.
@mzspcgg Are you able to reproduce this issue with the latest RainbowKit version ?
@mzspcgg Any updates ?
Sorry, I can't check, because I just use Wallet Connect now.
@mzspcgg Can we close this issue for now ? If the issue persist we'll reopen this ?
Still facing this issue @magiziz It directly disconnects wallet if network is not same as required
@yashsisodiya Is your wallet getting disconnected when you change to the wrong network that's not supported ? Can you provide a small minimal reproducible example ?
@yashsisodiya Is your wallet getting disconnected when you change to the wrong network that's not supported ? Can you provide a small minimal reproducible example ?
You can check below. Behaving weird on mobile, Metamask switch chain doesn't work. For iOS, the connected event comes late. https://codesandbox.io/p/devbox/rainbowkit-sign-887fq3?file=%2Fsrc%2FApp.tsx%3A151%2C39 @magiziz
@yashsisodiya Heard back from the WalletConnect team and seems like MetaMask isn't working as expected in most times. It sometimes works fine and sometimes doesn't. This means you have to manually either switch the network in app, or just disconnect and connect again to the right network. Ideally you can use browser wallet which helps as well.