detect-provider icon indicating copy to clipboard operation
detect-provider copied to clipboard

Does not detect ethereum provider if redirection happens into the metamask mobile browser

Open poonam125sharma opened this issue 4 years ago • 6 comments

If a dApp redirects the user to the metamask mobile app using deep-link, then this library does not detect provider on page load,

const provider = await detectEthereumProvider();

if (provider) {
  // Detected
} else {
  // window.ethereum is undefined
}

When the dApp opens into the metamask mobile app browser, then always for the first time, it goes into the else condition and when page is reloaded, then it works fine.

Any suggestion is appreciated. Thanks.

poonam125sharma avatar Oct 20 '20 10:10 poonam125sharma

Works fine on my Metamask Mobile Browser maybe you need to update the app then it may work, Let me know if it worked.

sangya2001 avatar Nov 04 '20 12:11 sangya2001

Hi @sangya2001 I have the same problem. Sometimes the Mobile Browser detects de web3 and sometimes it does not. I found out that this is not specially related to this package. The web3 detection fails sometimes anyway on my Android.

Any help is appreciated.

@poonam125sharma

arnoudcommandeur avatar Nov 10 '20 14:11 arnoudcommandeur

Try status.im browser it's really good.

sangya2001 avatar Nov 10 '20 15:11 sangya2001

Hi @sangya2001 I just tried. But it looks there is no qrcode scanner for http. Also deeplinking is not working for me when a querystring is added to the deeplink url. Do you use these features too?

arnoudcommandeur avatar Nov 10 '20 21:11 arnoudcommandeur

In mobile browser with MetaMask App installed, the provider has not been initialized. Android 8

flachica avatar Apr 02 '21 09:04 flachica

same problem Android 11 MetaMask v5.1.1

Ash-hs avatar May 30 '22 04:05 Ash-hs