question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

After connect to the metamask, it redirect back to a new tab instead of the original URL

See original GitHub issue

Describe the bug When using some android device to connect to the DApp via Metamask Mobile App.

  • once the user click Connect button from Metamask, it redirects to a new Tab that contains a random number from the URL link.
  • The wallet is connected to the DApp but User has to close the Tab

SDK Version (if relevant)

  • Version 1

To Reproduce Steps to reproduce the behavior:

  1. Go to ‘https://opensea.io/’ using Android devices
  2. Click on ‘Connect Wallet’
  3. Select ‘WalletConnect’
  4. Select Metamask
  5. Click Connect from Metamask
  6. Error Happened: Metamask will redirect to the browser but open a new Tab. which the url something like: wc:c4e********@1?bridge=https%3A%2F%2F5.bridge.walletconnect.org&key=********

Expected behavior 6. Metamask will redirect to the browser with the existed website

Smartphone (please complete the following information):

  • ZTE Blade A462 (Android 6.0.1)
  • Samsung Galaxy Note8 (Android 9)
  • Google Pixel 6 (Android 12)

Additional context This issue happens when you installed only Metamask on your device. if you instead of multiple wallets, the user would not experience this issue.

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:10
  • Comments:12

github_iconTop GitHub Comments

7reactions
dungnn1991commented, Jul 7, 2022

I have found the solution. Instead of connecting with “connect button”, use deep link:

await connector.createSession(); const encodedUri = encodeURIComponent(connector.uri); const href = 'https://metamask.app.link/wc?uri=${encodedUri}&target=_self'; //walletconnect use _blank window.location.href = href;

Walletconnect use target=_blank

Screenshot from 2022-07-07 09-36-08

2reactions
peteremiljensencommented, May 17, 2022

We are also experiencing this issue in our own app. It has worked before

Read more comments on GitHub >

github_iconTop Results From Across the Web

Redirect back to App from Metamask Mobile after connection
I am trying to connect a mobile app with Metamask Mobile. I use a deep link like metamask.app.link/www.myapp.com/metamask?autosign=1234.
Read more >
How do I link a metamask account redirect to a particular web ...
I am working on a blockchain project, where a user registers his/her blockchain account a particular entity and then logs in with their...
Read more >
One-click Login with Blockchain: A MetaMask Tutorial - Toptal
This article introduces a new login method to blockchain development: A one-click, cryptographically-secure login flow using the MetaMask extension, ...
Read more >
How To Buy and Send ETH, And Use MetaMask Mobile's ...
You can check your transaction status on a block explorer like Etherscan, by clicking the pop-up link. After you have ETH in your...
Read more >
How to redirect from browser to Metamask or similar app like ...
I have a website that detects metamask and connects with it on pc, but on the android mobile app browser when I open...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found