WalletConnectModalFlutter icon indicating copy to clipboard operation
WalletConnectModalFlutter copied to clipboard

[Example] The example is not working

Open AyushBherwani1998 opened this issue 2 years ago • 14 comments
trafficstars

Describe the bug I have updated the project id in the sample, upon clicking the wallet, it does open the wallet but no request for connection is shown in the wallet.

To Reproduce Steps to reproduce the behavior:

  1. Add project id
  2. Click on any wallet of your choice, tried with Metamask, Trust, and Rainbow.
  3. See the wallet open but no connection request is shown

** Screenshot ** As you can see, it says connecting, but it never shows any connection request. IMG_C7CE215DE74E-1

Expected behavior A connection request should be shown when the wallet opens.

Smartphone (please complete the following information):

  • Device: iPhone 11
  • OS: iOS 16

AyushBherwani1998 avatar Oct 24 '23 06:10 AyushBherwani1998

Hello @AyushBherwani1998, is this still happening? Just to understand better, what you have done is:

  1. Clone the repo
  2. Set your projectId in /example/lib/home_page.dart
  3. Ran the app and tried to connect with those wallets Is that correct? Coz I have been doing the same and I'm able to connect properly.

quetool avatar Oct 24 '23 08:10 quetool

Hey @quetool, yes I did the same but apparently the connection request is not shown. Moreover, I tried those wallets with https://react-app.walletconnect.com/ and it works fine.

AyushBherwani1998 avatar Oct 24 '23 10:10 AyushBherwani1998

Do you mind trying Web3Modal? https://github.com/WalletConnect/Web3ModalFlutter

quetool avatar Oct 24 '23 10:10 quetool

https://pub.dev/packages/web3modal_flutter/versions/3.0.0-beta09

quetool avatar Oct 24 '23 10:10 quetool

Sure, let me go through it.

AyushBherwani1998 avatar Oct 24 '23 10:10 AyushBherwani1998

@quetool web3modal_flutter is working fine. Tried the 3.0.0-beta09 version.

AyushBherwani1998 avatar Oct 24 '23 11:10 AyushBherwani1998

Great! Web3Modal is almost on release version, it's quite safe to use it already but I'd understand if you prefer to use WalletConnectModalFlutter. However it might take some time before I'm able to take a look at that repo.

quetool avatar Oct 24 '23 13:10 quetool

@quetool got the issue, apparently the WalletConnectModalService accepts both IWeb3App and projectId along with metadata. I was setting the projectId inside the home_page but since the example passes the IWeb3App it was causing the issue. It was working fine to show me the list of wallet, because it uses local variable projectId in the Explorer service, and for the pairing and auth it uses IWeb3App.

Just curious, we should only keep IWeb3App instead of also accepting the projectId and metadata or vice versa to avoid confusion. Happy to raise the PR if it make sense to you.

AyushBherwani1998 avatar Oct 24 '23 18:10 AyushBherwani1998

@AyushBherwani1998 thats great! AFAIK it should be either the web3app instance (which requieres a projectId) OR the projectId into the service. So, should be either one or the other. We might need to take a look sooner than I thought.

quetool avatar Oct 24 '23 19:10 quetool

@quetool would be happy to contribute. IMO we can deprecate the web3App and only take the projectId and metaData. WDYT? In the more upcoming releases we can remove the web3App once users have migrated to the remove the usage of web3App. Since it's already published, we can do a soft migration.

AyushBherwani1998 avatar Oct 25 '23 04:10 AyushBherwani1998

That could be a good idea, I might need to check the impact. Btw by "we" I meant we at WalletConnect but I really appreciate the willingness! I will get back to you ASAP!

quetool avatar Oct 25 '23 07:10 quetool

@quetool any updates?

AyushBherwani1998 avatar Dec 20 '23 06:12 AyushBherwani1998

Hey @AyushBherwani1998 ! Sorry for the delay on this! If you are asking about removing web3App object from the constructor I haven't had time to talk discuss this with the team but in any case is not a priority for us. Also, having the ability to pass a web3app as well allows the dev to have a bit more of flexibility since Web3App() accepts a Core() object itself.

What I can do right now to avoid your described issue is to add a check to validate web3App.core.projectId over projectId.

quetool avatar Dec 20 '23 09:12 quetool

Also, I strongly recommend to try Web3Modal out, it has been released for production since we last spoken 👌

quetool avatar Dec 20 '23 09:12 quetool