metamask-mobile icon indicating copy to clipboard operation
metamask-mobile copied to clipboard

Deeplinks open MetaMask wallet but not MetaMask browser

Open hiroshi-yamamoto-dublr opened this issue 3 years ago • 3 comments

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

  1. Launch a MetaMask deep link from a mobile website, in the Chrome for Android.
  2. Tap "Open in MetaMask".
  3. 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?

hiroshi-yamamoto-dublr avatar Jul 30 '22 04:07 hiroshi-yamamoto-dublr

Cannot find inpagebridgeweb3.js? How to inject Web3?

AdelaDella avatar Jul 31 '22 08:07 AdelaDella

@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.

hiroshi-yamamoto-dublr avatar Aug 04 '22 05:08 hiroshi-yamamoto-dublr

@RNHaoHao I don't understand your question... I don't use that js file in the example I linked.

hiroshi-yamamoto-dublr avatar Aug 09 '22 02:08 hiroshi-yamamoto-dublr

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 avatar Aug 11 '22 09:08 tommasini

@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 avatar Aug 12 '22 01:08 hiroshi-yamamoto-dublr

@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 avatar Aug 12 '22 09:08 tommasini

@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 avatar Aug 12 '22 20:08 hiroshi-yamamoto-dublr

@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.

tommasini avatar Aug 15 '22 15:08 tommasini

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)?

hiroshi-yamamoto-dublr avatar Aug 18 '22 07:08 hiroshi-yamamoto-dublr

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!

tommasini avatar Sep 20 '22 13:09 tommasini

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).

brianonchain avatar Nov 16 '23 22:11 brianonchain