Walletconnect not working on android

I am working on linking my Dapp with metamask through walletconnect. I am using typescript for this purpose. The issue is that walletconnect is not working on android. On the web platform, the walletconnect shows all the available wallets. When i click on metamask (on web platform), it directs me to the metamask website rather than opening the installed extension on my browser. On the android platform, walletconnect doesn’t show any of the wallets available. Moreover, the connect button in walletconnect does nothing; neither it shows an error nor it does anything. I am being stuck on this for quite a while. Any sort of help will be appreciated. Waiting for support from Moralis team.

this is my code:

async login() {
    console.log('loginworking');
    this.user = Moralis.User.current();
 if (!this.user) {
await Moralis.Web3.authenticate({
        signingMessage: 'Login via App',
        provider: 'walletconnect',
      });
 await Moralis.Web3.enableWeb3({
          provider: 'walletconnect',
        });   
 } //if condition ending here
  } //function ending here

I am using Moralis (0.0.184) and walletconnect (1.6.6)

When MetaMask is opened from wallet connect, it looks for installed MetaMask apps rather than browser extensions.

Is there a metamask or any wallet app installed on the android?

Yes @johnversus, metamask is installed on the android device. But, it doesn’t detect that. Can you help me please?

Can you try using WalletConnect with this demo (works on my Android to go to MetaMask), to see if it’s an issue with your project or your phone’s settings.

Demo

@alex this is coded in javascript but i am doing it in typescript using ionic. Can you relate something with typescript? Thankyou in advance.

That shouldn’t matter unless you’re getting errors in your console and/or terminal. And it will work the same way. I’m just asking you to check that deployed demo to see if you can connect to MetaMask via WalletConnect on your phone.

okay let go through it.

I have tested the demo project on the android, wallet connect is detecting metamask app in android. When i click metamask it directs me to metamask browser and doesn’t authenticate further.
Can you further help me. I am working with angular and ionic for the project.

@alex it doesn’t authenticate, it only opens MetaMask app and doesn’t show any authentication message or signing message on metamask. Did it twice as you said but no effect.

@alex i test my project (angular one) on the localhost in my android and it shows detection of Metamask but doesn’t authenticate but once I build an apk or run directly on the android without the localhost the confirm button does nothing. Waiting for your help brother. Thankyou

Can you try uninstalling and reinstalling MetaMask on your mobile and try out the demo again. We just want to make sure we can get it working on an app we know should work fine.

Okay, let me do that and get back to you @alex

1 Like

Did this ever get fixed? I am having the same issue. I have deployed my dapp via appflow to android and when the user attempts to connect the wallet it does not populate the mobile links, just a connect button. The connect button does nothing.

Can you post your code or a project repo on GitHub please. Does the “user” have a mobile wallet like MetaMask? Also on Android, there won’t be any mobile links by default (like on desktop).

The user does not have any wallets but the trust wallet on their android. The wallet connect call does bring up the modal but it only has a connect button that does not work.

this.wallet = await Moralis.Web3.authenticate(

    {

      provider: 'walletconnect',

      chainId: 56,

      mobileLinks: [

        "rainbow",

        "metamask",

        "argent",

        "trust",

        "imtoken",

        "pillar",

      ],
  });

Can you get them to try WalletConnect to Trust Wallet with this demo to see if it’s an issue with their phone or your app.

Also in your code, you can do Moralis.authenticate instead of Moralis.Web3.authenticate (deprecated unless you’re using an old version of the Moralis SDK, in that case I would recommend updating).

It did not work @alex I have tried almost each version of moralis and wallet connect but the connect button does nothing… I have also defined custom webpack config file but no progress been stuck on this for almost 2 weeks now.
And I am not using react so please share some JavaScript or TypeScript solutions. The example you are sharing is based on react. Waiting for your response

I have updated moralis, walletconnect, @walletconnect/web3-provider…everything and the connect button does not work. Id like to add that I am also developing an ionic/angular app.

[EDIT] Same behavior on an iPhone X

Hello, similar issue here.

I’m implementing wallet authentication via WalletConnect in a fresh CRA project (Simple web app, no mobile native stuff involved). It works well when I browse from desktop and use the qrcode feature.

However, when I browse from my Android phone I never receive the signature request.
I press the Connect button on WalletConnect modal, which prompts my wallet apps installed (Metamask, TrustWallet…). I pick one of them, the app launches (or focus if already opened) but I don’t receive any signature request.

FYI:

Answer for myself and anyone else who would land here. Looks like it’s a development-related issue. I deployed my app using moralis server hosting and the signature request is properly sent to my wallet apps.

Now I have another challenge to figure out which is how to keep the user session active without requiring a new signature after a refresh, which I found out is easy to do with Metamask by calling enableWeb3 again but can’t manage to make working with WalletConnect…But that’s another topic. Happy coding guys :slight_smile: