Connection to MetaMask via WalletConnect on mobile doesn't prompt to switch network
Opened this issue · 0 comments
php4fan commented
I have modified sample.js only to not set the infura ID and to use the BSC mainnet:
diff YOUR/sample.js MY/sample.js
2c2
< KV.set_infuraID(YOUR_INFURA_ID);
---
> //KV.set_infuraID(YOUR_INFURA_ID);
3a4
>
10c11
< web3network: KV.rpc_codes.ETH_MAINNET
---
> web3network: KV.rpc_codes.BSC_MAINNET
On an android phone with MetaMask installed:
- make sure I don't have the BSC network currently selected in MetaMask
- open the demo in Chrome
- click on the Connect button
- proceed to connect via WalletConnect and choose MetaMask as the app to open
Expected: MetaMask should prompt me to confirm switching to the BSC network
Observed: MetaMask only prompts me to connect, but remains on whatever network I'm currently in. The demo page is then happy and reported I'm connected.
(note: I have the BSC network configured in MetaMask, and I have accounts on it).
Compare this to:
- on desktop Chrome, open the demo and choose to connect directly to MetaMask (the browser extension, without using WalletConnect)
- in this case behaves as expected. MetaMask asks me for confirmation to switch to the BSC network
Not entirely sure if this could be a bug in MetaMask, WalletConnect or your demo. Usually the topmost element in the stack is the suspect unless proven otherwise.