metamask-mobile
metamask-mobile copied to clipboard
Deeplinks open MetaMask wallet but not MetaMask browser
Describe the bug MetaMask deeplinks do not open the target link in the MetaMask dapp browser, they only open the MetaMask wallet.
I went to https://metamask.github.io/metamask-deeplinks and generated a dapp deeplink to https://dublr.github.io/dublr-ui , which yielded the deeplink https://metamask.app.link/dapp/dublr.github.io/dublr-ui .
In my mobile app, I set
onboardButton.onclick = () => window.location.href = "https://metamask.app.link/dapp/dublr.github.io/dublr-ui";
However tapping on this button in the Android Chrome browser only opens the MetaMask app, MetaMask doesn't actually follow the deeplink URL and display https://dublr.github.io/dublr-ui in the MetaMask dapp browser.
To Reproduce
- Launch a MetaMask deep link from a mobile website, in the Chrome for Android.
- Tap "Open in MetaMask".
- The MetaMask wallet will open, but it shows the main MetaMask view, rather than opening the MetaMask browser on the deep-linked dapp like it is supposed to.
Expected behavior MetaMask should follow the deeplink. I don't know if the deeplink generator is broken, or if MetaMask is broken.
Smartphone (please complete the following information):
- Device: Samsung Galaxy S22 Ultra
- OS: Android latest
- App Version: 5.3.0
to be added after bug submission by internal support / PM Severity
- How critical is the impact of this bug on a user?
- Add stats if available on % of customers impacted
- Is this visible to all users?
- Is this tech debt?
Cannot find inpagebridgeweb3.js? How to inject Web3?
@RNHaoHao I don't get that error on my end... Web3 is injected by the MetaMask browser extension, or you can open the dapp in the MetaMask built-in browser on mobile.
@RNHaoHao I don't understand your question... I don't use that js file in the example I linked.
hey @hiroshi-yamamoto-dublr thanks for reporting!
The deeplink it's working fine, but metamask app must be on background already, this is a known issue, we are working to solve it.
@tommasini Thanks for the reply -- what does "on background" mean? The app opens, but it just shows the wallet screen, it does not enter the embedded browser.
@hiroshi-yamamoto-dublr please try to enable supported links, on your device, go to Settings -> default apps -> scroll until you find MetaMask -> supported links and you will have the links that the app is allowed to open
@tommasini There is no "supported links" option under the MetaMask "App Info" page.
I searched settings for "supported" and "links", and I don't see any option anywhere in settings.
I'm using a Samsung Galaxy S22 Ultra.
@hiroshi-yamamoto-dublr Open Android settings , search 'default' and select "Choose Default apps' > "Choose Default apps" > Opening Links > scroll down to MetaMask and tap it > Supported Web addresses > check if links are selected or "verified/trusted" by default (most importantly metamask.app.link). If they are not, then check them/it.
Thank you, I found them this time. All URL formats were unchecked. This must have been the issue.
Why does the MetaMask app not enable these by default (or ask the user to check these settings when it is first installed)?
We are communicating with branch.io in order to solve this issue, it's happening with some Android 12 devices.
Since the issue it's solved I will close this one, feel free to open a new one if you see something wrong with the app. Thank you again!
hey @hiroshi-yamamoto-dublr thanks for reporting!
The deeplink it's working fine, but metamask app must be on background already, this is a known issue, we are working to solve it.
Hi @tommasini, has there been any workaround for this? Requiring that MetaMask already be running in the background in order to deeplink into the MetaMask browser is kind of bad UX.
Edit: I just want to add that the MetaMask SDK solves this (MetaMask does not need to be running in the background). But, I want my users to use the MetaMask browser instead of the original browser because I think it’s better UX (if using MetaMask SDK, you switch into the MetaMask app 3 times just to make a transaction! Whereas if you stay within the MetaMask browser, you just get pop-ups and feels faster and nicer).