I think I have the same issue.
I’m using detect-provider from Github in my hybrid app (installed via npm i @metamask/detect-provider).
When I run my app on Chrome it works fine but when I build that for Android (native app) and deploy it on my mobile device (which has Metamask installed) I get:
@metamask/detect-provider: Unable to detect window.ethereum.
I don’t know what I have to do in order to request eth_requestAccounts on a native Android app.
Hi there, i seem to be facing the same issue with ethereum not being injected on MetaMask mobile in-app browser. In my case I’m using an android device and at times ethereum does get injected but more often not. Can someone please help
Hi there, yes, the window.etheruem object gets injected but ay times get unloaded. On my android device I have installed MetaMask. I open its in app browser and type my applications site. On the click of a button where i need to trigger MetaMask, window.ethereum at times gets injected but most often not. window.ethereum comes up as ‘undefined’. I tried setting a higher timeout but nothing happens. I looked into all solutions provided on stackoverflow, MetaMask github and other and tired taking out heavy tags in , setting timeouts, adding listeners but nothing seemed to solve the issue. Is there a workaround this? and why does the injection happen on and off?