metamask-mobile icon indicating copy to clipboard operation
metamask-mobile copied to clipboard

wallet_switchEthereumChain and wallet_addEthereumChain dont do anything

Open emadhamad171 opened this issue 5 years ago • 12 comments

Describe the bug I use wallet_switchEthereumChain and wallet_addEthereumChain in react native dapp, i create session wallet connect and after that when user clicks specific button, i call sendCustomRequest and it only opens metmask mobile and there is no switch confirmation and actually there is no any response, just opens metamask no error nothing

Screenshots Screenshot 2021-09-03 at 11 31 39 AM

Expected behavior popup with confirmation A clear and concise description of what you expected to happen

Smartphone (please complete the following information):

  • Device: OPPO
  • OS: Android 10

Maybe i missed something, help me to resolve it or this flow not working yet

emadhamad171 avatar Sep 03 '21 08:09 emadhamad171

Related to #3581

gantunesr avatar Jan 21 '22 14:01 gantunesr

I have the same issue, can anyone answer it?

DecodingByte avatar Feb 28 '22 09:02 DecodingByte

@DecodingByte This fix will be included in v4.2.0

gantunesr avatar Mar 05 '22 15:03 gantunesr

@emadhamad171 @DecodingByte can you verify if this is fixed in the latest release?

gantunesr avatar Apr 07 '22 04:04 gantunesr

It's working in metamask version 5.3.0.

tarun1089 avatar Jul 15 '22 10:07 tarun1089

@sethkfman could this issue be related to #3312?

hesterbruikman avatar Apr 19 '23 10:04 hesterbruikman

This is again not working with Wallet Connect V2.

I can't switch the chains

mubshrx avatar Jun 17 '23 13:06 mubshrx

I have this issue when using WalletConnect V2 as well.

GabrielBuragev avatar Jun 27 '23 13:06 GabrielBuragev

Same here, I have this issue when using WalletConnect V2.

equalogix avatar Jun 29 '23 04:06 equalogix

@gantunesr I have also encountered this problem. May I ask how to handle it? This is how I operate.

"dependencies": {
    "@walletconnect/ethereum-provider": "^2.8.6",
  },
import { EthereumProvider } from '@walletconnect/ethereum-provider';

const provider = EthereumProvider.init({
  projectId,
  chains: [5], // REQUIRED chain ids
  showQrModal: true,
  relayUrl: "wss://relay.walletconnect.org",
  optionalChains: [1, 5, 56, 137, 10, 100],
  optionalMethods: [
    'eth_sendTransaction',
    'wallet_switchEthereumChain',
    'wallet_watchAsset',
    'wallet_addEthereumChain',
  ],
  optionalEvents: ['accountsChanged', 'chainChanged', 'network', 'disconnect'],
})


// Switch network,  But there is no response on the Metamask Mobile App.
provider.request({
      method: "wallet_switchEthereumChain",
      params: [{ chainId: id.toString(16) }],
  })

liubin595338764 avatar Jul 05 '23 12:07 liubin595338764

This issue has been automatically marked as stale because it has not had recent activity in the last 90 days. It will be closed in 7 days. Thank you for your contributions.

github-actions[bot] avatar Oct 03 '23 13:10 github-actions[bot]

This issue was closed because it has been stalled for 7 days with no activity. If you feel this was closed in error please reopen and provide evidence on the current production app. Thank you for your contributions.

github-actions[bot] avatar Oct 10 '23 14:10 github-actions[bot]