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

User does not get prompted to connect metamask wallet to other dapp

Open jmquilez opened this issue 3 years ago • 5 comments

Describe the bug User does not get prompted to connect metamask wallet to flutter dapp when using walletconnect_dart package or any other packages with the same purpose. Usually happens when user is asked to re-authenticate using password/fingerprint in metamask after opening metamask app from flutter dapp in order to connect the wallet.

Screenshots Expected behavior (1): Screenshot_20220908-172612_MetaMask

Actual behavior (2) Screenshot_20220908-172602_MetaMask

To Reproduce

  1. Clone the repo from the following url: 'https://gitlab.com/graflr/flutter_rarible_example'
  2. Connect your smartphone to your computer, (make sure to have flutter installed), and run "flutter devices". Copy the id of your phone and then run "flutter run -d<phone_id>" in order to run the project on your phone. You can also run it in a simulator; in any case, make sure you have metamask mobile app installed in your device
  3. When the app launches, click on the "connect wallet" button: you will be redirected to metamask app and if everything goes well, you should get the pop-up message that appeared in the screenshot before. From the flutter app again, click on "disconnect wallet" and then on "connect wallet" again. Repeat the process until you are not prompted to connect your wallet (as the first screenshot showed).

Expected behavior Metamask should prompt you to connect your wallet to the flutter app (as shown in screenshot number 1)

Smartphone (please complete the following information):

  • Device: Samsung Galaxy A51 5G, should potentially happen on any android and/or ios device
  • OS: Android 12
  • App Version: 5.6.0, there are also reports about the same from several months ago

Severity I'm concerned about the fact that reopening the metamask app solves it, but please. This is not a solid workaround, and definitely not a solution for a production-ready dapp. From my perspective, it is worth it for the metamask team to look into this and give it a try in order to fix it.

jmquilez avatar Sep 08 '22 15:09 jmquilez

Same issue here.

jydelort avatar Sep 16 '22 18:09 jydelort

Hey @jmquilez, thanks for reporting! Could you tell me if that is happening with you only when MetaMask mobile app is closed? (Not in the background) If that confirms we are aware and working on it!

tommasini avatar Sep 19 '22 14:09 tommasini

For me the problem is when the app is already opened, running in the background and asks me to reauthenticate again.

jydelort avatar Sep 20 '22 16:09 jydelort

@jydelort you also have this issue with an android 12, when you mean reauthenticate you mean connect again? Could you send a record for we try to understand better how to replicate it?

tommasini avatar Sep 20 '22 23:09 tommasini

Hey @tommasini, in my case the issue happens both whenever the app is closed or running in the background, no matter whether I have to reauthenticate again or I'm already authenticated

jmquilez avatar Sep 21 '22 14:09 jmquilez

I have the same problem

https://user-images.githubusercontent.com/34720083/198093631-7d107250-3145-4d04-9ec7-f08ea6ccb41f.MP4

I send the video and the url I used launching uri: metamask://wc?uri=wc%3Aa0aadf03-016b-418f-9271-9d36e673140a%401%3Fbridge%3Dhttps%253A%252F%252Fv.bridge.walletconnect.org%26key%3D65fccc07185772cc38d8f95e51a9cfd010f3316d0826608a9ce0bb8d0a3999a2

Igormikheev avatar Oct 26 '22 17:10 Igormikheev

Any updates on this?

jmquilez avatar Dec 14 '22 13:12 jmquilez

Bump.

340rahul avatar Jan 05 '23 13:01 340rahul

@andreahaku Same issue over here, there is any way we can help you to debug this?, it is a terrible experience when using metamask APP

ronpetit avatar Feb 20 '23 23:02 ronpetit

so few questions: is it only happening on Android or iOS as well? If Android, is it happening on 12 or later? Is it only happening with Dart/Flutter package or this happens on other platforms libraries (you can try using https://example.walletconnect.org/). Thanks

andreahaku avatar Feb 21 '23 10:02 andreahaku

I have only tested over Android, on 12 or later, I tried just a few times, but with https://example.walletconnect.org/ seems to be working well

I will test over iOS and post my results

ronpetit avatar Feb 21 '23 12:02 ronpetit

This issue has been automatically marked as stale because it has not had recent activity in the last 90 days. It will be closed in 7 days. Thank you for your contributions.

github-actions[bot] avatar Jun 04 '23 19:06 github-actions[bot]

This issue was closed because it has been stalled for 7 days with no activity. If you feel this was closed in error please reopen and provide evidence on the current production app. Thank you for your contributions.

github-actions[bot] avatar Jun 14 '23 14:06 github-actions[bot]

Is there any update on this? I am facing this issue as well

soosan-shabnam avatar Jul 04 '23 20:07 soosan-shabnam

Have you found the solution?

rahulkoffeekodes1 avatar Jul 20 '23 06:07 rahulkoffeekodes1

Somebody should be really trying to fix this bug, it makes the app experience a lot worse up to a point that it doesn't even look professional.

jmquilez avatar Aug 17 '23 12:08 jmquilez

KEY UPDATE FOR EVERYBODY INTERESTED IN THE ISSUE

This issue was originally created because the walletconnect connection prompts weren't occasionally showing up in the metamask mobile app, after the user was asked to connect their wallet from a dapp (I recall it used to work in other apps such as trustwallet); sometimes they did, sometimes they didn't, and it all happened quite in a random way and without an apparent cause. However, lately these prompts have ceased to work completely in all wallet apps because as mentioned in the latest walletconnect_dart issue (RootSoft/walletconnect-dart-sdk#111), walletconnect v1 has been shutdown and is no longer functional, making necessary a migration to walletconnect v2 (https://pub.dev/packages/walletconnect_flutter_v2). I have published an updated version of the rarible app (which I mentioned in the first comment, https://gitlab.com/graflr/flutter_rarible_example, but this link is unfortunately no longer working and the rarible example app has been removed from the Graflr gitlab repo) that you can find here: https://github.com/jmquilez/rarible. Just run the app in your device and tap the "Connect" button.

The key walletconnect_v2 modifications start at https://github.com/jmquilez/rarible/blob/ac66bffa4d4627b0fffae90aae24ad4a6c5eca22/lib/main.dart#L886 and are basically three functions that serve as a replacement for the original login function.

Apart from the connection prompt show-up times being sometimes oddly longer than expected (I'll probably open an issue about this on the walletconnect v2 repo in the future), so far I have not experienced this same issue with the same high frequency as originally reported, but there is still room for improvement (mainly regarding metamask, as I've tested it with trustwallet (which btw doesn't support some networks, as Polygon Mumbai) and it is consistently quicker to open. Might open an issue about it in the future). Please notify in case the original issue still happens to you.

Thanks :)

jmquilez avatar Aug 21 '23 13:08 jmquilez