[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.

You can enable it by following the steps below:

  • Open Trust Wallet on your Android device.
  • Click to your settings.
  • Under Preferences, Select DApp browser.
  • Turn it on (Enable).

From the bottom menu, tap DApps once the feature has been enabled. Then, select the DApp you wish to use and follow all the steps for connecting Trust Wallet to the DApp.

You Can Also Check For iOS Device On Our Website Here Not Allowed.

Sorry, did you get the connection to work on IOS (not just in the metamask browser)? I just tried the link about and it doesn’t seem to work for me (IOS Safari) and I struggle with the same problem myself…

/Robert


when I try to send a transaction my native app redirects me to Metamask or selected wallet but it’s not proceeding further or doing anything like it only opens Metamask app. can you please help me there

@minisatoshi please can I have your source code in Github, I really need this

What are you wanting/trying to do? Did you try working with the given example above?

let web3;
if (provider == 'walletconnect') {
          const user = await Moralis.authenticate({ provider: provider});
          web3 = await Moralis.enable({ provider });
} else {
          const user = await Moralis.authenticate();
          web3 = await Moralis.enable();
}

Hello, I have the same problem on my react project, on the web the qr code works and it asks for the signature but when I open my application in a mobile device (IOS) it only opens the metamask app but it does not trigger the popup with the request is signed and therefore I do not get a return in my applicationCapture