Metamask mobile sdk can't redirect back to the app after connecting

I’m working on a react native app and building it as an android app. I’ve followed all the steps related to the MetaMask sdk integration on the docs but after the app launching and connecting MetaMask it never gets my application back to foreground and the code after launching ‘eth_requestAccounts’ method is never reached

const loginWallet = async () => {
try {
const result = await ethereum.request({method: ‘eth_requestAccounts’});
console.log(‘RESULT’, result?.[0]);
} catch (e) {
console.log(‘ERROR’, e);
}
}

On that example the console.log is never used because the app never comes to foreground again

My code related to MetaMask sdk

const MMSDK = new MetaMaskSDK({
openDeeplink: (link) => {
Linking.openURL(link);
},
timer: BackgroundTimer,
dappMetadata: {
name: ‘My Dapp’,
url: ‘my dapp website’,
},
});

const ethereum = MMSDK.getProvider();

const loginWallet = async () => {
try {
const result = await ethereum.request({method: ‘eth_requestAccounts’});
console.log(‘RESULT’, result?.[0]);
} catch (e) {
console.log(‘ERROR’, e);
}
}

1 Like

hello vicspexi,

you are absolutely right,

i am developing the mobile DApp one month ago,

the MetaMask work fine,

when our dapp connect to MetaMask, just the response from MetaMask very slow ( is about 10 seconds… wow… slow right ) and no sign at all from MetaMask

but, after 10 seconds waiting in MetaMask wallet, connect button show up and after click it, redirect to our mobile DApp.

But, the version start from 3 april 2023, MetaMask made a new improvement, however, we still waiting for maybe 10 seconds, MetaMask show the connect image ( wow… ), so anyone knows that they are still waiting for the MetaMask response.

and, this new version sometime show variable “startWith is undefined” in our debug terminal

may i post the image or video in here?
so, everyone can see the issue and what is happening behind the scene.

The latest MetaMask update should fix this. If you still continue to see issues after the update, please let us know!

and just for information,

i have installed an opensea that using walletconnect

when, connect to MetaMask, the MetaMask is instantly reponse. so, there is no waiting, the connect button instantly show up ( very fast ).

connect and direct to the opensea DApp.

So, the question is? can we do the same thing for our mobile DApp?

What codes? are used by the walletConnect?
Why so powerful which can instruct the MetaMask wallet to show the connect button instantly?

We all waiting for your help MetaMask support.

hello support,
i just tried just now 5 minutes ago.

the latest version of MetaMask 6.3.0 ( launched on 6/april/2023 ).
still can not return back to our mobile dapp?
our maybe MetaMask new SDK? just published 8 hours ago

MetaMask 6.4.0 is releasing very soon, let us know if you have issues then!

1 Like

A post was split to a new topic: Error MetaMask SDK

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