rainbowkit icon indicating copy to clipboard operation
rainbowkit copied to clipboard

[bug] On mobile, pressing to any Recent wallet is not responding.

Open pctsvn opened this issue 2 years ago • 19 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues

RainbowKit Version

1.0.2

wagmi Version

1.2.0

Current Behavior

On mobile, if I use Chrome, pressing to any Recent wallet is not responding. All good if I use Safari.

CleanShot 2023-07-06 at 17 26 33

Expected Behavior

It should work well on mobile. Can you please help me on this? It's very urgent to me

Steps To Reproduce

No response

Link to Minimal Reproducible Example (CodeSandbox, StackBlitz, etc.)

No response

Anything else?

No response

pctsvn avatar Jul 06 '23 10:07 pctsvn

@pctsvn Hi! I can't seem to replicate this issue. What device/OS are you using? Can you share a CodeSandbox reproducible example for me to look at and diagnose?

DanielSinclair avatar Jul 06 '23 18:07 DanielSinclair

Happen the same to me (rainbowkit v 0.12.17), I'm using a customised examples/create-with-reactapp from the repository. It has custom adapter. When trying on desktop all good (via VPN), but when connecting on mobilePhone (via VPN) it does not respond. I'm using an android Redmi 9. I will try to give you some code to reproduce later. Thanks

danielSoler93 avatar Jul 07 '23 07:07 danielSoler93

The same thing is also happening to me.

I believe it’s also happening on the nextjs codesandbox example from rainbowkit.

This is the example codesandbox url from them and when you open it on mobile clicking any of the wallet behaves poorly. Only coinbase works for mobile.

https://3rc6yz-3000.csb.app/

https://codesandbox.io/p/sandbox/github/rainbow-me/rainbowkit/tree/main/examples/with-next

niikkiin avatar Jul 09 '23 07:07 niikkiin

@niikkiin I see. The issue you're likely seeing here is that you haven't provided a WalletConnect projectId (by replacing YOUR_PROJECT_ID) and/or whitelisted the deployment domain, so WalletConnect redirects on mobile are quietly failing. Reference the docs here for more information on this new WalletConnect v2 requirement. You should see console errors like this when testing the sandbox examples. We'll amend the example and docs with better error handling for this scenario. Let me know if that fixes the issue! Screenshot 2023-07-09 at 11 35 59 PM

DanielSinclair avatar Jul 10 '23 03:07 DanielSinclair

@danielSoler93 @pctsvn Let me know if the above guidance resolves your issue as well. Apologies for the WalletConnect v2 confusion.

DanielSinclair avatar Jul 10 '23 03:07 DanielSinclair

@niikkiin I see. The issue you're likely seeing here is that you haven't provided a WalletConnect projectId (by replacing YOUR_PROJECT_ID) and/or whitelisted the deployment domain, so WalletConnect redirects on mobile are quietly failing. Reference the docs here for more information on this new WalletConnect v2 requirement. You should see console errors like this when testing the sandbox examples. We'll amend the example and docs with better error handling for this scenario. Let me know if that fixes the issue! Screenshot 2023-07-09 at 11 35 59 PM

hey ser @DanielSinclair thanks for getting back to me! I already had the project id for wallet connect configured on my original project. the one i linked on my comment is the codesandbox from the rainbowkit's documentation where the same issue is happening to me - clicking on any wallet such as metamask, walletconnect, rainbowwallet etc (except coinbase) does not take me anywhere nor open anything similar to this PR's issue. I've tested it on safari, chrome and brave mobile browsers.

"@rainbow-me/rainbowkit": "^1.0.4",
"next": "13.4.5",
"wagmi": "^1.3.4",
"viem": "^1.2.9",

niikkiin avatar Jul 10 '23 11:07 niikkiin

Hi guys, I fixed the issue by clearing localStorage when the app loads the first time. Hope it is helpful to you!

pctsvn avatar Jul 10 '23 14:07 pctsvn

@niikkiin The RainbowKit examples you're referencing don't currently contain a valid projectId, so you would need to set that before they work correctly. The projectIds are a secret that needs to be approved/obtained from WalletConnect. But we'll work on getting a shared one for the examples to reduce confusion here.

DanielSinclair avatar Jul 10 '23 14:07 DanielSinclair

@niikkiin The RainbowKit examples you're referencing don't currently contain a valid projectId, so you would need to set that before they work correctly. The projectIds are a secret that needs to be approved/obtained from WalletConnect. But we'll work on getting a shared one for the examples to reduce confusion here.

Thanks for the response again ser. I am also referring to the original project that I am currently working on. It already has the projectId secret from the WalletConnect but whenever someone clicks on the wallet on mobile, it does nothing. It would connect normally when on desktop.

I have 4 wallets connected which are metamask, coinbase, walletconnect and rainbow wallet. Some behaviors that are happening on my end are when you’re on safari mobile and chrome mobile, only coinbase would redirect. And when you’re on brave mobile, only coinbase and metamask would work. But when I’m on desktop, all wallets connect fine with no error from core/relayer at all.

Does it really have something to do with the wallet connect project id?

niikkiin avatar Jul 10 '23 21:07 niikkiin

here

I'm facing the exact same problem, everything works for desktop but nothing happens when I click on the WalletConnect in the mobile browser (inc: "safari")

kuji2336 avatar Jul 18 '23 12:07 kuji2336

@kuji2336 Are you able to replicate the issue when connecting on rainbowkit.com?

DanielSinclair avatar Jul 18 '23 14:07 DanielSinclair

@kuji2336 Are you able to replicate the issue when connecting on rainbowkit.com?

I was using "walletconnect" and "web3-react" packages together with rainbowkit package, after removing them and fresh build, problem solved. image

kuji2336 avatar Jul 18 '23 16:07 kuji2336

i can confirm im experiencing the exact same behavior on a Next.JS project that uses a custom Alchemy provider, rainbowkit works great on desktop, but on mobile it doesnt trigger a wallet connect redirect except with coinbase wallet.

Like others have said, nothing happens on either iOS or Android when using either chrome, safari, brave, etc.. the only solution seems to using the MM browser directly.. will comment again when i find the solution for my build

devacadian avatar Jul 25 '23 23:07 devacadian

@kuji2336 Are you able to replicate the issue when connecting on rainbowkit.com?

Hey @DanielSinclair I'm experiencing the exact same issue on my project. I just tested connecting on rainbowkit.com and I get the same behaviour when using Brave but it works when using Chrome.

OS: Android 13 Chrome 116.0.5845.163 (Works) Brave 1.57.53, Chromium 116.0.5845.114 (Not Working)

williamluke4 avatar Sep 04 '23 07:09 williamluke4

@pctsvn Are you still seeing this issue on your end ?

Can you update the package @rainbow-me/rainbowkit to the latest version 1.3.3 ?

Let me know if the "recent" wallets on mobile are working fine now.

magiziz avatar Jan 17 '24 22:01 magiziz

@pctsvn Any updates ?

magiziz avatar Jan 21 '24 22:01 magiziz

@KosmosKey I tried upgrading to 1.3.3 and the issue is still there

pelkonator avatar Jan 31 '24 02:01 pelkonator

@pelkonator Are you using a VPN when testing this out ? If you try to clear history and refresh would it work then ?

Usually you should get a prompt screen to redirect to the chosen wallet. Also are you able to share the code so i can have a look at it ?

magiziz avatar Feb 03 '24 00:02 magiziz

@pelkonator Can you try updating to 2.0.0 and see if the issue still persists ? Please can you also mention the wallets you have installed on mobile ?

magiziz avatar Feb 16 '24 18:02 magiziz

@pctsvn Is this issue still happening ?

magiziz avatar Feb 22 '24 17:02 magiziz

Going to close this issue for now since can't reproduce this on RainbowKit v2.

Please follow these steps to make sure your mobile wallets works with WalletConnect:

  • Create a project id in WalletConnect dashboard
  • If you're using preview links or if your app is deployed on prod make sure to enter your domain in the WalletConnect "Allowed Domains" section in the dashboard

If you're using safari browser and you click on "Recent wallet" then reject you won't be able to connect again due to how mobile linking works. We could try to do universal linking, but of course comes with it's own limitation here

If you're facing any other issues please feel free to raise another issue with a reproducible example 🙏

magiziz avatar Feb 26 '24 14:02 magiziz

I've a similar issue, when I connect on mobile it opens in metamask but does prompt for connection

Link to CodeSandBox

Current behavior :

https://github.com/rainbow-me/rainbowkit/assets/44323398/5a22f4cd-3be0-46e1-b898-5588e05059eb

Expected behavior:

https://github.com/coder/coder/assets/44323398/04f86d3c-45fe-4358-a213-29f7639652ca

weber77 avatar Jun 18 '24 20:06 weber77