[SOLVED] Wallet connect does not work on Trust Wallet and Metamask

I implemented “wallet connect” for the site using this documentation https://moralis.io/how-to-connect-users-with-walletconnect/

When I use PC and scan the QR code, it works perfectly and I can do what I want. But when I use it in a dApp browser in phone and select Trust Wallet or MetaMask, it does not work. Selecting Trust Wallet in Android simply redirects to Google with some wc://… and MetaMask opens App store on iOS and does nothing on Android.

The project is hosted here: minisatoshidev.herokuapp.com

Coul you explain what am I doing wrong?

I just tested your site on iOS and it seems to work fine, did you install MetaMask or TruestWallet on your phone?

1 Like

Thank you for replying! Okay, I checked it too:

  1. iOS/Android Chrome: Do wallet connect. It redirects to respective wallet to sign in. [Works OK]
  2. iOS MetaMask: Redirects to Play store on selecting MetaMask.
  3. Android MetaMask: Clicking on Connect in WC popup does not do anything.
  4. Android TrustWallet: Clicking on Connect in WC popup redirects to Google with wc:a6… in the search bar.

Where did you test it? In Chrome or some dApp browser such as Metamask or TW?

I tested it on Safari.

on MetaMask internal browser you may not need wallet connect, it should work without wallet connect

Yes, it should work without wallet connect . In the provider, I use “walletconnect”. What changes should I make so that it works without WalletConnect in dApp browsers?

async function authenticate() {
  try {
    user = await Moralis.Web3.authenticate({  
      provider: "walletconnect"} );
    web3 = await Moralis.Web3.enable({ 
      provider: "walletconnect",

      // mobileLinks: [
      //   "rainbow",
      //   "metamask",
      //   "argent",
      //   "trust",
      //   "imtoken",
      //   "pillar",
      // ] 
  });
    walletAddress = user.get('ethAddress');
    // console.log(user.get('ethAddress'));
  } catch (error) {
    console.log('authenticate failed', error);
  }
  renderApp();
}

maybe you can use something like this:

1 Like

Thank you! It is working now.

1 Like

We are having similar issues with our project and it’s inconsistent. I tried connecting to your site using iPhone and TrustWallet and was not able to. Can you confirm that your issue is resolved? Thx…

yes my issue is resolved. what problem are you facing?

I just tried connecting to the dev server. It’s working fine. :thinking:

Put one else condition (window.ethereum). It will identify web3 on MetaMask mobile.

Thanks for replying. Certainly looks similar on your prod as well when I try. I get connected on TW side but signature never reaches the site it seems to see me connected. Only issue with TW and it’s inconsistent from different users even with same devices/version…

FYI, I had couple more people test connecting to your prod and they have same issue with TW I do (connect button doesn’t work any more on your dev) We will continue to troubleshoot ours and if I find anything I will reply here. Hope you don’t take it wrong way but i’m “happy” i’m not the only one. Been trying to figure this out for couple of weeks now unsuccessfully.