Metamask lost connection on mobile after reload

Hi all, I’ve integrated MetaMask in our DAPP with @web3-react/injected-connector. It works fine on PC/MAC, but on any mobile, it lost connection after reloading the page and couldn’t connect again without another reload. Kindly help me to solve this issue. TIA
Here is my code const connectMetamaskMobile = async () => {

  if (typeof window.ethereum === "undefined") {
    setIsProvider(true);
  } else {
    try {
      if (isWalletConnect) {
        await deactivate();
      }

      await activate(injected);
      setLocalUse(true);
      setIsWalletConnect(false);
      setIsDisconnected(false);
    } catch (error) {
      console.log("Error on connecting: ", error);
    }
  }
}

Hello @rafiul86
Welcome to MetaMask community !)

What is error equal to in the catch block?
What other errors are there in the console?
Do you have a simplified version of your application that could be sandboxed?)

Also share your version of MetaMask wallet on the mobile device.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.