Mobile walletconnect redirects before sign message

I have a problem like this in the mobile web app (android, os): When User call authenticate method first user must click connect button in Metamask and after sign message. But in my case, after the user press connect button in Metamask mobile app it redirects to my website app before signing the message and the user can’t see the sign request if He/She doesn’t open Metamask mobile app again to see the sign request which already popped up.
Please help me with How I can fix this problem. Can I avoid redirecting to my web app before the user sign the message?

my code: ( code works perfectly. Only above mentioned problem )

var user;

user = Moralis.User.current();

async function walletConect(provider) {
    if (!user) {
        user = await Moralis.authenticate({
            provider: "walletconnect",
            mobileLinks: [provider] ,
            chainId: 56,
            signingMessage: "Welcome"

        }).then(function (user) {
            triggerConnect(provider);
          })
          .catch(function (error) {
        });
    }  
}

That is the default behaviour, they have to return back to the MetaMask app to then sign the message.

You could try a flow demonstrated in this demo where it uses setTimeout as an example to call Moralis.authenticate separately after using Moralis.enableWeb3 (which is for the connect site request) so it returns back to the app.

1 Like