walletconnect-monorepo
walletconnect-monorepo copied to clipboard
After connect to the metamask, it redirect back to a new tab instead of the original URL
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:
- Go to 'https://opensea.io/' using Android devices
- Click on 'Connect Wallet'
- Select 'WalletConnect'
- Select Metamask
- Click
Connect
from Metamask - 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.
Yeah, i'm not so sure this issue belongs here.. Since this isn't your app, the bug could have been caused by any number of issues you are not aware of.
We are also experiencing this issue in our own app. It has worked before
Yes, same with me. However, it was working fine earlier. Don't know what changed recently in last 15 days or so. Any help would be appreciated.
Yeah, i'm not so sure this issue belongs here.. Since this isn't your app, the bug could have been caused by any number of issues you are not aware of.
Experienced the issue on our own app, but put open sea as a example because I believe it is universal issue that happens for all the apps who integrate with walletconnect
Having same issue on chrome. I am testing on mobile and have found that the new page opens in chrome but not firefox.
Having same issue on chrome. I am testing on mobile and have found that the new page opens in chrome but not firefox.
Same with me. Firefox has no problem
I have a feeling it's when you click the connect button and it asked what do you want to open it with and I normally had two options: Metamask and Chrome. I could select just once or always open with this app.
When I selected Metamask it was fine but when I selected chrome I started seeing this issues.
Since I have started seeing this menu.
I appreciate this is vague but I hope if can help someone figure this out 😁
We are also facing the same issue... is there any work around
Any update on this issue ?
Having same issue on mobile chrome browser with Samsung galaxy fold 2.
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
I had the same problem on android. When opening a link to the browser metmask app, it automatically opens a new tab.
@hanhhdd did @dungnn1991 solution work for you? @carmen0208 is this still an issue?
Hi! I'm experiencing an issue with using the WalletConnectProvider in a Next + React project. It works as expected on iOS but not on Android. Has anyone found a solution for this issue?
EDIT: I found that the issue occurs on .enable()
function and the error message is User closed the modal
, but in fact the modal hasn't been closed, WC has loaded the wc:********@1?bridge=https%3A%2F%2Fy.bridge.walletconnect.org&key=*******************************************************
on another tab instead of just loading it as it works on desktop I guess.
await newProvider.enable().catch((error) => {
console.error(error); // User closed the modal
throw error;
});
@dungnn1991 Can you share the full code to achieve your solution?
Any update on this issue ?
I’m closing this issue because it has been inactive for a few months.
Please reopen if you still encounter this issue with the latest version :)